baml.http.reject_websocket

The `websocket` handler `serve` uses when none is supplied: refuse every upgrade, leaving the server HTTP-only.

Reference version

Signature

function baml.http.reject_websocket(req: baml.http.ServerRequest) -> baml.http.Response throws never

The websocket handler serve uses when none is supplied: refuse every upgrade, leaving the server HTTP-only.

RFC 6455 §4.1 fails the client handshake on any status other than 101; the status here says specifically that this server implements no WebSocket endpoint, rather than blaming the request.

Source:<builtin>/baml/ns_http/server.bamlbytes 7391–7539