Documentation
¶
Overview ¶
Package wsdial wraps the gorilla WebSocket handshake so a failure says what the peer actually answered.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Dial performs the WebSocket handshake and, on failure, returns an error that identifies which hop rejected it.
gorilla answers every non-101 response with the same bare `websocket: bad handshake`, so the log line reads identically whether:
- the application rejected it — 401 `{"error":"invalid sync token"}`
- the route is not registered — 404, or 503 "sync not configured"
- an ingress has no matching rule for this vhost/path — 404 from nginx
- an edge proxy refuses upgrades outright — 403 from Envoy, and the request never reaches the application at all
The distinguishing evidence is already in the second return value gorilla hands back and was being discarded: the status, the `Server` header naming the hop that answered, and `X-AgentBox-Server-Version`, whose presence proves the request reached an AgentBox backend rather than dying in front of it.
Types ¶
This section is empty.