Public tunnel safety
A public tunnel gives your local Gateway an internet-accessible URL. Use it only when a private network, Tailscale, or SSH cannot meet the requirement.
Before starting
- Back up xopc state.
- Generate a strong Gateway token.
- Run
xopc doctor --security. - Review every Agent, tool, channel, connector, and extension reachable through the Gateway.
- Read and accept the risk notice in Settings → Remote access.
Remote browser sign-in
Open Settings → Remote access on the Gateway host and generate a browser pairing code. Open the public HTTPS URL in the remote browser and enter the code within five minutes. Browser sessions renew during authenticated use, expire after about seven days of inactivity, and require a new code after 30 days. Use Revoke all remote browsers on the Gateway host to end browser sessions and invalidate any pending code.
Paired browsers have the same Gateway owner access as a console signed in with the Gateway token, including administrative settings. Pair only browsers you trust with that access. After upgrading from limited browser access, accept the updated security notice to restart the tunnel and generate new pairing codes for existing browsers. The public listener accepts browser pairing and paired-device credentials. FRP connects to a dedicated loopback listener even when the administrator console listens on a different address.
Webhook and MCP clients use their own configured credentials. Approve built-in MCP OAuth grants through a trusted administrator entry point. Serve interactive site shares on their dedicated share hostname to keep shared content isolated from the console session.
Main risks
- Treat an unused browser pairing code as a credential until it expires.
- Traffic passes through tunnel infrastructure outside the local host.
- Public exposure increases automated scanning and credential-guessing attempts.
- A broad agent permission extends what an authorized remote session can do.
Safer operation
- Keep the tunnel off when it is not needed.
- Avoid automatic startup unless continuous public access is intentional.
- Never put the URL, token, registration secret, or pairing QR in a public screenshot.
- Use pairing or allowlists on message channels.
- Review logs and rotate credentials after any suspected disclosure.
- Stop and release the public address when the integration is retired.
Use xopc tunnel --help for the installed version's start, status, stop, and release commands. Confirm the Gateway still requires authentication after the tunnel starts.
For most personal access, follow Tailscale instead.
Recovering an active lease without its local token
OAuth authorization creates a registration key; it does not replace an existing lease's tunnel token. An active instance extends its lease on every heartbeat, so waiting for expiry does not work while that instance remains connected.
When ordinary registration reports TUNNEL_RECOVERY_PROOF_REJECTED, choose Recover connection in device pairing or remote-access settings. The Gateway sends an explicit recovery request to POST /api/tunnels/recover, signed by its original Ed25519 identity with that endpoint as the signature audience. The Broker requires a valid registration key and the same reserved Gateway id, public key, user, workspace, and principal. It replaces the lease atomically, preserving the public hostname and invalidating the previous tunnel and FRP tokens. This action intentionally disconnects any other instance using that Gateway identity. Ordinary registration still requires the current tunnel token to replace a live lease; it never performs automatic takeover.
Deploy the updated platform Broker before the updated Gateway/UI. A Broker that does not support recovery returns an explicit update-required error. If the original Gateway identity or its owning account is unavailable, this recovery path cannot take over its reservation; administrator assistance is required. Do not delete xopc.db or tunnel.json to fix this error. A failed cloud release retains local recovery credentials and reports failure instead of claiming the lease was released.