Skip to content

Management console ​

After you sign in, the console displays menus and actions based on your account role and operation grants.

NavigationPages
Runtime StatusOverview, Operations Monitoring, Proxy Diagnostics, and Traffic History
ClientsClient List, with certificates, access settings, runtime details, and logs in each client's details
ResourcesMappings, Domains and Certificates, Certificate Rotation, Port Resources, MQTT Relays, Common Targets, and Protocol Catalog
NotificationsNotification Channels and Notification Templates
SecuritySecurity Groups, GeoX Data, and Security Management
SystemAudit Records, Configuration History, Job Scheduling, Accounts and Permissions, Proxy Configuration, and System Settings

Accounts and permissions ​

  • The built-in roles are Administrator (admin) and User (user). Installation on an empty database creates only the administrator account admin. Later starts use the stored password hash and skip the initial password settings. The administrator can open System → Accounts and Permissions (系统 → 账号与权限) to create users, configure User role grants, suspend user sign-in, and reset temporary passwords. Users who sign in with a temporary password must change it.
  • The User role is disabled by default and starts with no grants. Grant the required page and action permissions, then enable the User role. The global role switch and each account switch are independent. Both must be enabled for a user to sign in or use a session. Disabling the role revokes existing User sessions and blocks new sign-ins. Users must sign in again after the role is re-enabled.
  • The server checks resource ownership and operation grants. Viewing a page, reading a list, and writing a resource can require different grants. Creating, editing, or deleting an MQTT relay requires a signed-in administrator with the corresponding operation grant. Management API

Two-factor authentication ​

  1. After signing in, open Two-Factor Authentication from the account menu and verify your current password.
  2. Add the displayed secret to an authenticator that supports RFC 6238, then enter its code within 5 minutes to complete enrollment. Authenticator codes use six ASCII digits and change every 30 seconds.
  3. Copy or download the 10 recovery codes when enrollment displays them, then confirm you have saved them offline. Each code works once. The server stores only digests. You can check the remaining count under Two-Factor Authentication in the account menu.

Once enabled, sign in with your account password and a two-factor code. If your authenticator is unavailable, submit your password and enter one recovery code. Select the option to reset two-factor authentication to consume that recovery code and remove the previous enrollment and all its remaining recovery codes during sign-in. If an administrator just reset your password, you can clear the enrollment with a recovery code at sign-in, then change the temporary password when prompted. You can enroll a new authenticator after signing in.

Use an authenticator code to confirm password changes, account management, device access changes, client enrollment key replacement, device identity revocation, certificate downloads, and backup restore. Accounts without two-factor authentication use the current password. Enter an authenticator code to turn off an active enrollment from the account menu. Enabling or disabling two-factor authentication ends the account's other sessions. Management API

System settings ​

Open System → System Settings (系统 → 系统设置).

  • General (常用) sets the theme to system, light, or dark. The current browser saves this preference.
  • Appearance (外观) lets you change the site name and upload a site icon (SVG or PNG), an optional dark icon (SVG or PNG), and a favicon (ICO). Dark mode uses the custom site icon when the dark icon is omitted. Select Save Settings to apply your changes.
  • System Information (系统信息) shows the site name. The running version appears after you sign in and complete any required initial password change. The sign-in page hides the running version.
  • Backup (备份) lets administrators on a single gateway set S3-compatible object storage and a schedule, then create, download, or restore backups. Select Restore on a completed record and review the overwrite scope, then confirm with the administrator's two-factor code or the current password if two-factor authentication is off. Manual and scheduled backups run online. An in-place restore interrupts console and client connections. Backup and restore

Add a client ​

  1. Open Clients → List (客户端 → 列表) and choose Add client (添加客户端).
  2. For direct access, set the client registration key in client_key or TUNNEL_CLIENT_KEY. Install the deployment root CA's public certificate through a trusted channel and point root at the file. Set the control endpoint and web_endpoint for enrollment. The latter defaults to the gateway's PQC HTTP/3 ingress on 9650/UDP. The client generates its ML-DSA-87 private key and CSR locally.
  3. You can also download a pre-issued certificate ZIP from Details → Certificate. If two-factor authentication is enabled, every download requires an authenticator code. Other accounts confirm with the current password and can download again within 5 minutes in the same session. Extract client.pem, client.key, and tunnel-ca.pem into cert/. On Linux, set the private key to mode 0600 and let the client account read it.
  4. Set a work relay if needed, start the client, and check that it appears online. Client setup

To connect through a broker, choose MQTT bridge when adding a client, select an enabled MQTT profile and its authentication mode, then download the deployment ZIP with app.yml. Configure an MQTT relay · MQTT setup

Edit a client name or enrollment key ​

  • In Clients → List (客户端 → 列表), select Edit (编辑) beside Details to rename the device. This requires permission to configure clients. Existing mappings continue to reference the client ID.
  • Open Details → Client Key and select Edit Client Key (编辑客户端密钥). Enter 64 lowercase hexadecimal characters or select Generate Random Key (生成随机密钥). Select Next, enter an authenticator code or your current password, then select Verify and Save. This requires client key permission and a fresh verification for each replacement.
  • After saving, update the effective client_key or TUNNEL_CLIENT_KEY on the client. Future enrollments use the new key. Current connections and issued certificates continue under their existing authorization. Client configuration

Certificate rotation ​

  • Resources → Certificate Rotation → Client Certificates shows each certificate's fingerprint, validity, rotation policy, and operation status. With rotation permission, you can start, cancel, or retry a rotation and perform an emergency revocation. After submitting a rotation, wait for client authentication to confirm the new certificate, then check its active generation and fingerprint.

  • System administrators can open Gateway and Keys to renew the gateway certificate, rotate its private key, and manage the Tunnel CA, transport token, and notification encryption keys. Available operations depend on the deployment. Managed Tunnel CA rotation uses a successor issued offline and supplied to the gateway. Certificate rotation

  • For a device whose certificate has expired and whose access is still enabled, open Clients → List → Details → Certificate and select Recover Expired Certificate (恢复过期证书). Verify your account, download the recovery ZIP, and deploy it to the original device. Expired certificate recovery

Create and verify a mapping ​

Start a temporary HTTP service on the provider.

sh
mkdir tunnel-demo-http
python -m http.server 8000 --bind 127.0.0.1 --directory tunnel-demo-http
  1. Under Resources → Port Resources (资源 → 端口资源), register 18080 and grant access to the corresponding account or provider if needed.
  2. Under Resources → Mappings (资源 → 穿透映射), choose New mapping. In the mapping type drawer, choose Native mapping and select Continue. Use TCP as the ingress protocol, choose an online provider, and select 18080 as the listen port. Set the destination address to 127.0.0.1, the port to 8000, and the target protocol to TCP. Leave Forward source address off for Python's HTTP server, which expects an HTTP request immediately.
  3. Enable the mapping and confirm it is applied and listening. From the access side, open http://GATEWAY:18080/. On the gateway host, use http://127.0.0.1:18080/.

Check port resources ​

Under Resources → Port Resources, check the Registration Status (登记状态) and Actual Status (实际状态). Registration status reflects whether the port and its group are enabled. The server probes the gateway's configured listener addresses and protocols every 45 seconds, and the list shows the measured status.

Actual statusMeaning
Available (可用)The relevant protocols can bind and the port is unallocated and idle
In use (已使用)A mapping holds the port or Tunnel is already listening
Occupied (被占用)At least one relevant protocol cannot bind to the configured address, for example because another process holds it or the system restricts it

Select Test (测试) on a row to check that port again and refresh its status. The status label shows the result for each protocol. A port is probed again when you delete and re-register it. Keyword, registration status, and actual status filters can be combined. Dedicated WS/WSS route ports are checked for TCP only. When you create a native mapping, business route, or dedicated WebSocket path, the gateway checks the required listener again.

Choose a mapping type ​

TypeConfiguration under MappingsAccess address
Native mappingChoose TCP or UDP ingress, the listen port, target client, address, port, and protocolTCP or UDP port on the gateway
Route mappingBusiness Routes offers Web Reverse Proxy, HTTPS Passthrough, and TCPMUX. WebSocket TCP/UDP forwards WebSocket messages to TCP or UDP servicesApplication port and domain, with optional routing by path or CONNECT target name
Visitor mappingChoose source client A and its listen address and port. Then choose target client B and the service address, port, and protocolListen address and port on source client A

Visitor mappings ​

  1. Choose New mapping, then Visitor mapping. Select TCP or UDP as the ingress protocol. For the access mode, choose Gateway relay or Private relay. Private relay is STCP for TCP and SUDP for UDP. With a TCP ingress, you can also choose Prefer direct (XTCP), which requires TCP as the target protocol.
  2. Choose an online direct-connect client as source A and fill in its listen IP and port. Use 127.0.0.1 for access from A itself, or A's LAN IP for access from the local network. Leave Gateway ingress blank under Gateway connection settings to use the server's advertised endpoint.
  3. Choose target client B and enter an address, port, and protocol reachable from B. Gateway relay and private relay support TCP, UDP, HTTP, HTTPS, WS, and WSS targets. Saving the mapping requires A to bind the listen address and port. Manage additional source clients in Details → Access grants after saving. Private access example

Work relay ​

A mapping can inherit the provider's work relay or choose a relay supported by the gateway and provider. A target client enrolled through MQTT uses its broker profile. You can explicitly choose MQTT bridge or inherit the provider's relay. For routes that mix direct and MQTT target clients, inherit each provider's relay. A WebSocket TCP/UDP path inherits the relay for each target. MQTT setup

Configure an MQTT relay ​

  1. As an administrator, open Resources → MQTT Relays (资源 → 中继 MQTT) and add a relay. Enter the broker address, TLS port, topic namespace, and the domain or IP on the Tunnel server certificate as the Tunnel TLS server name.
  2. Enter the server's broker username and password. For independent authentication, add a credential reference and broker account for each client. Enable shared authentication if the clients should use the server's broker credentials. Enabling a relay requires an explicit ML-DSA-87 broker CA and a broker that negotiates TLS 1.3 with MLKEM1024 and TLS_AES_256_GCM_SHA384. For mutual TLS, provide the ML-DSA-87 client certificate chain and matching unencrypted PKCS #8 private key for the relevant credentials.
  3. Bind the target client to the enabled relay during enrollment and apply the deployment ZIP. The ZIP includes mqtt-ca.pem for broker verification and mqtt-topics.txt for topic permissions. Supported mapping forms can also add a relay or enroll a target client. To move an existing direct client to MQTT, enroll and deploy it with MQTT access settings. Disabling a relay closes its active bridge connections. Remove client associations before deleting the relay. MQTT setup

The Runtime Status column (运行状态) shows how many devices are waiting, connecting, retrying, or online. It also shows the last successful connection, the last failure stage, and the last observation time. Troubleshoot MQTT

Business routes and authentication ​

Web Reverse Proxy routes multiple sites on one application port by domain and path. When the Tunnel gateway terminates HTTPS, WSS, or application HTTP/3, import the domain's ML-DSA-87 certificate chain and matching private key under Resources → Domains and Certificates. Application HTTP/3 uses UDP on the application port. With HTTPS Passthrough (target handles TLS), the gateway selects a route using SNI and the target handles TLS with its own certificate. TCPMUX uses a TCP port from the pool and routes by CONNECT target name. Business ingress and certificates

Match Basic username (optional) selects a route using the username in the Web request's Authorization header or the TCPMUX request's Proxy-Authorization header. Leave the field blank for a default route. To verify a password, configure Basic authentication with the same username and a password. Web Reverse Proxy example · TCPMUX example

  1. Open Resources → Tunnel Mappings → Active Links (资源 → 穿透映射 → 活动链路). Filter by protocol or search by mapping path, source address, or link ID. With Auto Refresh on, the visible page polls every 3 seconds.
  2. Select a link to see its source, provider, visitor, transport, start time, last activity, and cumulative traffic in both directions. Current speeds use the difference between successive samples.
  3. Select Rate Limit to add an inbound or outbound limit to this link. Inbound traffic travels from the visitor to the target. Clear one direction or reset both to their defaults, then save. Existing mapping and client bandwidth policies still apply.
  4. Select Disconnect and confirm to end the selected connection or UDP session. The mapping can still accept new connections. Each XTCP direct row represents one QUIC connection between the peers. Changes apply to all TCP streams it carries.

Links are scoped to the signed-in account. Public business routes also require permission to view public resources, and changing their links requires public route management permission. Rate limits and disconnections on other links require mapping edit permission. An XTCP direct link supports rate changes when its provider can negotiate that capability. Active links API

Forward source addresses and HTTP headers ​

Forward source address defaults to off for new TCP-to-TCP and UDP-to-UDP native mappings and for new business routes. When enabled, Tunnel uses the HAProxy PROXY protocol v2 to send the original source IP address and port. TCP targets must parse the binary header at the start of the connection. UDP targets must parse the header before every datagram. On Linux, Windows, and macOS, a native UDP listener can use a wildcard address and obtain the actual ingress address. Turn off forwarding if the target does not support PROXY v2.

For a native or visitor mapping with an HTTP, HTTPS, WS, or WSS target, specify the request path. For HTTP/HTTPS, you can also set the request method and parameter format. Select Add header under Target request headers or Handshake request headers and use a fixed value or the actual source IP or port. Web Reverse Proxy has separate Forward request headers and Forward response headers rules that can also reference a header from the original request to the gateway. If the original header is missing, the destination header keeps its current value. Set Host in a request header rule.

You can configure up to 24 rules per direction. Resolved rules can produce up to 96 header values and 32 KiB per direction. The gateway manages reserved connection, WebSocket handshake, source, and hook headers. A request rule that sets X-Real-IP can only use Original source IP. The management API returns fixed header values only to accounts with permission to edit the corresponding configuration. The same permission applies to pending changes, mapping versions, and live events. Web Reverse Proxy example

Security groups ​

Open Security → Security Groups (安全 → 安全组) to create allow or deny rules and set the default action for unmatched requests. Use a single IP address, a CIDR range, GEOIP,CN, GEOIP,!CN, GEOIP,LAN, or IP-ASN,13335 as a source. You can restrict the business protocol and ingress port or leave them blank for any protocol and port. Lower priority numbers match first. Among rules with the same priority, the first matching rule in the list takes effect. Preview the result with a source IP, protocol, and port before binding the group to a mapping. GeoX data

GeoX data ​

Open Security → GeoX Data (安全 → GeoX 数据) as a system administrator. GeoX and automatic updates are enabled by default. The default interval is 24 hours and the minimum is 30 minutes. The default MetaCubeX sources provide geoip.dat, geosite.dat, country.mmdb, and GeoLite2-ASN.mmdb. Set a custom public HTTPS URL for any source or restore one or all defaults.

Save the settings before selecting Update now (立即更新). Leave the download proxy field blank to connect directly. Tunnel activates the batch after all four downloads pass validation and keeps the last valid batch if an update fails. Security groups and ban rules match source IPs, countries or regions, local networks, and ASNs. The GeoSite file updates with the other data. Source rules evaluate IP addresses only. GEOIP,!CN matches only addresses with a known country or region outside mainland China. GeoX updates and recovery · Proxy configuration

Management ingress IP bans ​

Open Security → Security Management (安全 → 安全管理) as a system administrator. The page includes login and password policy, failed login records, and IP bans.

  • Ban Rules accepts IPv4 and IPv6 addresses, CIDR ranges, and GeoX sources. A ban can be permanent, end at a specific time, or last a duration in years, months, weeks, days, hours, minutes, or seconds.
  • IP Ban Records → Manual Ban accepts IP addresses, CIDR ranges, and GeoX sources. Use a duration or an expiration time from 1 minute to 365 days ahead. Manage CIDR and GeoX entries under Ban Rules. Individual IP records let you adjust expiration or lift a ban directly.
  • The server normalizes abbreviated CIDR input. For example, 10.90/16 is saved as 10.90.0.0/16. 0.0.0.0/0 matches all IPv4 sources. The server rejects a new ban that matches the source address of the current management request.

In IP Bans → Ban Rules, select Test and enter a single IPv4 or IPv6 address. The dialog shows matching active rules and their expiration times. The lookup leaves ban records and failure counts untouched.

Tunnel applies bans before processing management requests. Direct connections and HTTP upstream requests to 9650/TCP use the connection peer IP. When Nginx on the same host forwards a request over the management socket, Tunnel uses the single valid X-Real-IP set by Nginx. 9650/UDP is the separate device enrollment ingress. Management request addresses

Notifications, alerts, and deliveries ​

Use Notification Channels to configure DingTalk, WeCom, Feishu, webhooks, or SMTP email. After adding an alert rule, check Alert Instances for trigger and recovery status, then open Delivery Records for delivery results. With notification management permission, you can test a channel, resend eligible deliveries, and preview, edit, or restore default notification templates by channel and event. Notification setup

Configure download proxies ​

Open System → Proxy Configuration (系统 → 代理配置) as a system administrator and add an HTTP, HTTPS, SOCKS5, or SOCKS5H proxy. Use Quick Add (快捷添加) to enter proxy URLs. Each proxy can have a fallback. When a connection, transfer, or data validation fails during a GeoX download, Tunnel tries the next proxy in the chain. It skips disabled or expired proxies and rejects circular fallback chains.

Test Connection checks the default GeoIP source and attempts to look up the public egress IP. Quality Check also checks the default ASN source and reports latency and the egress region when available. Tunnel encrypts proxy passwords at rest and omits them from exports. Select a GeoX download proxy

Save common targets ​

Open Resources → Common Targets (资源 → 常用目标). Use Destination Addresses or Service Ports to save internal addresses and ports to your account. When filling out a tunnel target, select a saved value or enter your own.

On a new installation, Service Ports for the administrator account starts with presets for common open-source services. Examples include Nginx / Caddy over HTTP 80 and HTTPS 443, PostgreSQL 5432, Redis / Valkey 6379, Mosquitto / EMQX over MQTT 1883, and Prometheus 9090. New accounts also receive these presets.

Manage access, logs, and configuration history ​

  • Under Clients → List → Details → Manage, toggle access and confirm with your two-factor code or your current password if two-factor authentication is off. Deleting a client disconnects it and invalidates its key and certificates.
  • Details → Client Logs supports search, live follow, and JSONL downloads. Open an event to see the full message and raw JSON. Find gateway logs under Runtime Status → Operations Monitoring → System Logs.
  • Client details show the current control protocol and the protocol generation and time of the last successful handshake. The last observation is available while the client is offline.
  • Overview shows the status of resources available to your account. Operations Monitoring shows gateway and management API metrics. Proxy Diagnostics shows mapping, provider, and direct or relay state, with on-demand probes available to authorized users. Traffic History supports filtering by time, resource type, and resource, with export available to authorized users. The chart uses the same unit for upload and download traffic so they can be compared directly.
  • System → Audit Records tracks actors, actions, and results. Job Scheduling shows run records and lets authorized users preview schedule times, save a schedule, or run a job manually. Choose the IANA time zone from the searchable list when editing a schedule. Resources → Protocol Catalog lists ingress configuration status and protocol use cases. Accounts with the relevant permission can customize protocol display names.
  • Filter System → Configuration History by device, resource, or operation. Open Details for the timeline. Client and mapping details also show related records. Rolling back a mapping revision submits a new change. Troubleshooting