onConnection
External Documentation
void
onConnection(
Registers a handler for new client connections
Implementation
void onConnection(
void Function(WebSocketClient client, String? url) handler,
) =>
_server.on(
'connection',
((JSWebSocket ws, JSIncomingMessage request) {
final client = WebSocketClient(ws);
final url = _extractUrl(request);
handler(client, url);
}).toJS,
);