Skip to content

Reach it from other machines

You have a daemon on a server (Run on a server) and want the CLI, the desktop app or OpenClaw on another machine to use it. This page keeps the daemon off the public internet by putting both machines on a Tailscale network (a tailnet).

Why the daemon needs HTTPS

The daemon only accepts plain HTTP on localhost: --listen must be a loopback address, and the CLI refuses an http:// URL for any other host. To be reachable from another machine, the daemon needs an HTTPS address. There are two ways to get one:

WayHowGood when
Tailscale ServeServe the daemon’s localhost port over HTTPS on your tailnet name. The daemon config doesn’t change.You want the least setup.
Daemon’s own HTTPS listenerSet networkListen, tlsCertFile and tlsKeyFile in the daemon config (or pass --network-listen, --tls-cert-file and --tls-key-file to wx serve). All three are required, and the port must differ from listen. See Configuration.You already have a certificate for the server’s name.

Tailscale’s own commands are documented by Tailscale. Follow its guide for Serve to publish http://127.0.0.1:6174 on your tailnet, and note the https:// address it gives you. Use that address as URL below.

1. Create a token for the client

Run this on the server (with Docker, prefix it with docker compose exec agent-wechat-native and add --token-file /run/secrets/wechat-api-token). Give each client its own token, limited to one account and the scopes it needs. See API tokens for the scope list.

Terminal window
wx tokens create laptop --accounts ACCOUNT_ID --scopes read --scopes send

The token is printed once, in the token field. On the client machine, save it in a file only you can read:

Terminal window
umask 077
mkdir -p ~/.config/agent-wechat
printf '%s\n' 'PASTE_TOKEN_HERE' > ~/.config/agent-wechat/box-token

2. Connect a client

  1. Open AgentWechat and choose Connect to another hub.
  2. Enter the hub’s https:// address and the token as the access key.
  3. If the hub uses a private certificate, paste it under Advanced → Private certificate (optional). A publicly trusted address, such as a Tailscale Serve address, needs no certificate.

3. Check it works

Terminal window
wx accounts list

You should see the accounts your token can use. If you get a connection error, confirm that both machines are online in Tailscale and that the address is the https:// one.