Skip to main content

Reference implementation in this repo

server/cmd/ws-test-client is a minimal scriptable Go client used to exercise ws-gateway during development — worth reading if you want to see the protocol driven end-to-end without a browser or emulator:

cd server
WS_URL=wss://<ws-gateway-host>/ws DEVICE_KEY=<device id> WATCH=1 DURATION=45s go run ./cmd/ws-test-client

(WS_URL defaults to ws://127.0.0.1:8090/ws if unset — useful for testing against a locally-run ws-gateway instead of the deployed one. DURATION defaults to 30s. SEND takes newline-separated raw JSON messages to send after connecting, for exercising any other request type, and UNWATCH_BEFORE sends an unwatch that long before exiting.)