Skip to main content

Module websocket

Module websocket 

Source
Available on non-WebAssembly only.
Expand description

WebSocket routes in tests: TestClient::websocket sends the opening handshake through the application, and when the route answers with WebSocket::upgrade’s 101, TestWebSocketRequest::connect runs its handler on a thread of its own over an in-memory duplex — the same handler the server would run, given the same reader and writer types it expects, with no socket in between. The test side is a TestWebSocket: it masks what it sends, as a browser does (the handler’s recv refuses unmasked frames), answers pings, and joins fragmented messages.

Structs§

TestWebSocket
The test side of an upgraded connection; see the module docs.
TestWebSocketRequest
A WebSocket upgrade request being built; see TestClient::websocket.

Constants§

DEFAULT_TIMEOUT
How long a TestWebSocket waits for the handler by default: 5 s.