CUB-203: add WebSocket client scaffold for OpenClaw gateway v3
Some checks failed
Dev Build / build-test (pull_request) Failing after 14s
Some checks failed
Dev Build / build-test (pull_request) Failing after 14s
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user