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§
- Test
WebSocket - The test side of an upgraded connection; see the module docs.
- Test
WebSocket Request - A WebSocket upgrade request being built; see
TestClient::websocket.
Constants§
- DEFAULT_
TIMEOUT - How long a
TestWebSocketwaits for the handler by default: 5 s.