Architecture
The same client can provide one service and access another. The provider connects to the private target. The visitor listens on a local port.
Control and data planes
Direct clients obtain device certificates and transport tokens over PQC HTTP/3 on 9650/UDP. They authenticate, receive configuration, and report status on 9651/TCP. Providers open work streams on 9652/TCP, 9652/UDP, or 9654/UDP, depending on the work relay. Authorized visitors connect on 9653/TCP or 9653/UDP. With MQTT bridging, both the gateway and client connect to the broker. Tunnel uses end-to-end mutual TLS for control and work streams over the broker, and broker access has its own authentication settings. Protocols and ports · MQTT access
Browsers reach the HTTPS site on Nginx using its publicly trusted certificate. Nginx forwards console and management API traffic through the local management socket or cleartext 9650/TCP. The HTTP/3 listener on 9650/UDP handles device enrollment, trust updates, and transport tokens. The Tunnel device client verifies the gateway certificate against the deployment's own CA. HTTPS reverse proxy
flowchart LR
accTitle: Control connections and traffic paths
Console["Web console"]
Nginx["Nginx on the same host"]
User["Public application"]
AccessApp["Private application"]
AccessClient["Visitor"]
Gateway["Gateway"]
Provider["Provider"]
Target["Private service"]
Broker["MQTT broker"]
Console -->|Cleartext management 9650/TCP| Gateway
Console -->|HTTPS| Nginx
Nginx -->|Management socket or HTTP| Gateway
User -->|Native or route ingress| Gateway
AccessApp -->|Local port| AccessClient
AccessClient -->|Visitor 9653| Gateway
Provider -.->|Enrollment 9650/UDP HTTP/3| Gateway
Provider -.->|Control 9651/TCP| Gateway
Gateway <-->|Work relay 9652 TCP/UDP or 9654/UDP| Provider
Gateway -.- Broker
Broker -.- Provider
Provider --> Target
AccessClient <-.->|XTCP direct| Provider
STCP and SUDP listen for TCP and UDP respectively on the source client and relay through the gateway. The provider connects to the private service using the mapping’s target protocol. XTCP uses UDP hole punching for direct TCP forwarding. When direct sessions can be reused, the visitor keeps up to two QUIC links per local visitor listener. New connections try the available primary and standby links before using the authorized gateway relay. XTCP
Security groups evaluate public mappings and routes using the source IP seen by the service listener. Management requests use their own IP ban rules. Direct management uses the connection peer IP. Nginx on the same host passes the visitor IP through the management socket. GeoX provides country, region, and ASN lookups for both. Source access policy · Management request addresses
The active links list shows current business connections. The gateway measures traffic it relays. Direct XTCP traffic stays between the two devices. The visitor reports link traffic over an authenticated signaling connection. A link-specific cap is enforced alongside the mapping and provider bandwidth budgets. Active links
Device trust
An offline root CA signs the Tunnel CA. The gateway imports the Tunnel CA signing material into its database and uses it to issue gateway and client certificates. The chain uses ML-DSA-87 throughout.
- At first enrollment, the client generates its private key and CSR locally, then verifies the gateway name and certificate chain over PQC HTTP/3. The gateway verifies the enrollment key and the CSR's proof of key possession.
- On the first control connection, the client proves possession of the new certificate's private key and the gateway activates that certificate. Control, relay, and visitor connections use mutual ML-DSA-87 certificate authentication and
MLKEM1024key exchange and theTLS_AES_256_GCM_SHA384cipher suite. The TLS 1.3 or QUIC handshake derives the session keys. Work connections also require a work ticket. Post-quantum TLS · Client configuration · Certificate implementation
sequenceDiagram
accTitle: Add a client and certificate issuance
participant O as Operator
participant G as Gateway
participant C as Client
O->>G: Add the client and obtain its enrollment key
O->>C: Deploy the public root certificate and enrollment key
C->>C: Generate a private key and CSR locally
C->>G: Verify the gateway and submit the enrollment key and CSR over HTTP/3
G-->>C: Return the device certificate chain and transport token
C->>G: Authenticate both peers and connect to the control plane
G-->>C: Confirm and activate the device certificate
Operators can also deploy a pre-issued client certificate ZIP. Direct clients also configure the enrollment key and use their local private key to obtain a transport token over direct HTTP/3 and refresh the bundled Tunnel CA when needed. MQTT clients use their deployment bundle and authenticate to the gateway end to end over the broker. Tunnel-terminated business TLS uses ML-DSA-87 certificates. For HTTPS passthrough, the target service handles the handshake. Public service ingress
Server hooks and client plugins
Server hooks call loopback HTTP services in addition to the built-in identity and permission checks. Admission hooks can deny events. The mapping close hook sends a notification. For public HTTP routes, the Register hook can store x-tunnel-hook-* annotations. The Access hook modifies the current request and response. An Access annotation takes precedence for the same header name. Hook settings · Hook implementation
Managed client plugins start built-in loopback services on the provider. Mappings point to those listeners. On Linux and macOS, managed virtual networking connects the two TUN interfaces over authorized STCP and installs a host route to the configured peer. Virtual networking