Documentation
¶
Overview ¶
websocket example — chat-style echo server.
go run ./examples/websocket wscat -c ws://localhost:8080/ws
Untyped on purpose — the request never completes ¶
An upgrade hands the connection to another protocol: there is no response body for a typed op's Out to be, and the exchange that follows is frames in both directions for as long as the peer stays. A typed op is one decode, one call, one serialize, so it cannot express this — which is why wsx.Upgrade takes an untyped handler and not a TypedHandler.
The cost is the same one every untyped route pays: no OpenAPI entry, no MCP tool, not reachable by zip.Call. Anything with a request-and-response shape belongs in a typed op instead — see examples/hello.
Click to show internal directories.
Click to hide internal directories.