websocket static method
raw WebSocket route. handler gets the open socket.
Middleware runs first, so it can check auth.
For rooms, acks and the socket.io clients, use dox_socketio.
Route.websocket('echo', (WebSocket socket, DoxRequest req) {
socket.listen(socket.add);
});
Implementation
static Route websocket(
String route,
WebSocketHandler handler, {
List<dynamic> middleware = const <dynamic>[],
}) {
return Route()._addRoute(
HttpRequestMethod.GET,
Route()._join(route),
<dynamic>[...middleware, _WebSocketRoute(handler).call],
);
}