connect method
Future<WebSocketConnection>
connect(
- HttpRequest request, [
- WebSocketConnectionRequest? connectionRequest
override
Implementation
@override
Future<WebSocketConnection> connect(HttpRequest request,
[WebSocketConnectionRequest? connectionRequest]) async {
if (connectionRequest == null) {
throw UnauthorizedException();
}
var socket = await WebSocketTransformer.upgrade(request);
return WebSocketConnection(
socket: socket,
id: request.connectionInfo!.remoteAddress.host,
token: connectionRequest.token);
}