CUB-203: add WebSocket client scaffold for OpenClaw gateway v3
Some checks failed
Dev Build / build-test (pull_request) Failing after 14s

This commit is contained in:
Dex
2026-05-20 11:02:21 +00:00
parent 519e872027
commit 70d39b87d1
5 changed files with 445 additions and 6 deletions

View File

@@ -69,11 +69,20 @@ func main() {
PollInterval: cfg.GatewayPollInterval,
}, agentRepo, broker)
// ── WebSocket client (connects to OpenClaw gateway WS v3) ─────────────
wsClient := gateway.NewWSClient(gateway.WSConfig{
URL: cfg.WSGatewayURL,
AuthToken: cfg.WSGatewayToken,
}, agentRepo, broker, logger)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go gwClient.Start(ctx)
// Start WS client in background; logs connection status
go wsClient.Start(ctx)
// ── Server ─────────────────────────────────────────────────────────────
srv := &http.Server{
Addr: fmt.Sprintf(":%d", cfg.Port),