Documentation
¶
Overview ¶
Package websocket-client demonstrates websocket Phase 2: a CLIENT-side DialDuplexAdapter connecting one go-codex process to another over a real WebSocket connection, plus AsyncAPI spec generation for the socket.
- SERVER: DuplexPort + DuplexSocketAdapter (Phase 1) — echoes commands
- CLIENT: a second DuplexPort (types mirrored: receives Update, sends Command) bound with DialDuplexAdapter — auto-reconnect with backoff, gap SocketErrors on the Errors channel, session generations c1,c2,…
- SPEC: ports.RegisterSocket renders the socket as an AsyncAPI channel (Subscribe = inbound frames, Publish = outbound frames) — OpenAPI cannot express WebSocket, AsyncAPI can
Running ¶
go run ./examples/websocket-client
Click to show internal directories.
Click to hide internal directories.