The proxy is what keeps the browser from ever seeing the Gateway token: the SPA opens a WebSocket to the same origin, and the proxy fills in
auth.token and a device signature on the connect frame before forwarding upstream. The device identity is a persistent keypair on disk (~/.clawboo/proxy-device-identity.json), so preview / incognito / fresh-machine browser contexts all connect without managing their own keys. Its device-auth primitives are also re-used by the server-side AgentSource connection (a non-browser GatewayClient) via the gateway-client signConnect hook.
Public API
Functions
Types & interfaces
The barrel exposes no classes or runtime constants.
WebSocketServer surfaces only as a field type on GatewayProxyHandle.wss (re-exported from ws, not from this package). The keepalive interval and frame-cap are config options on ProxyOptions, not exported constants.Used by
apps/web/server/index.ts, boots the proxy (createGatewayProxy) for the/api/gateway/wsupgrade and thecreateAccessGatefor HTTP/WS authorization.apps/web/server/lib/agentSource/registry.ts, re-usesloadOrCreateProxyDeviceIdentity+signConnectParams(+ theDeviceIdentitytype) so the server-sideOpenClawAgentSource’s non-browserGatewayClientsigns its own connect frames with the already-paired proxy identity.apps/web/server/lib/bootProbe.ts, callsgetProxyDeviceIdentityPathto check the vault/identity file location during the boot health probe.
Source
Barrel:packages/gateway-proxy/src/index.ts. Implementation: proxy.ts (the WS proxy + token/device injection + keepalive), access-gate.ts (the token-cookie gate), proxy-device-auth.ts (Ed25519 identity load/generate + connect-frame signing).
See also
- Gateway & events pipeline, where the proxy sits in the Gateway flow.
- Security, access gate, device auth, and safe exposure.
- @clawboo/gateway-client, the WS client whose
signConnecthook consumessignConnectParams. - @clawboo/config, source of
resolveClawbooDir, which locates the identity file.