-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection not upgraded to web socket #79
Comments
Connection upgrade issue |
i have working on signalr 8 and get the same error please help me if you have any solutions `message: Starting HubConnection. [2024-04-30 16:26:37.151692 SignalR LatLng] error: null [2024-04-30 16:26:37.202843 SignalR LatLng] error: null [2024-04-30 16:26:37.229015 SignalR LatLng] error: null E/gralloc4(10329): Empty SMPTE 2094-40 data [2024-04-30 16:26:38.195162 SignalR LatLng] error: null [2024-04-30 16:26:38.205808 SignalR LatLng] error: null [2024-04-30 16:26:38.228177 SignalR LatLng] error: null [2024-04-30 16:26:38.230771 SignalR LatLng] error: null [2024-04-30 16:26:38.231496 SignalR LatLng] error: null [2024-04-30 16:26:38.239084 SignalR LatLng] error: null [2024-04-30 16:26:38.240471 SignalR LatLng] error: null E/flutter (10329): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: WebSocketException: Connection to 'https://realtime.********.net:0/hub?id=5eftxqkWA1EFz7jv6lDMtQ&access_token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6ImY3NTZjNmJjLTEwYTQtNGE0Ny1jM2IwLTA4ZGM1Yzc2Y2Q1OCIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkRyaXZlciIsImV4cCI6MTcxNDQ5ODM2MywiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NzA4Ny8iLCJhdWQiOiJodHRwczovL2xvY2FsaG9zdDo3MDg3LyJ9.fuxYpVypm3nzA15qMwbO9wrmszNV48cpKlHom--o6A8#' was not upgraded to websocket [2024-04-30 16:26:38.923305 SignalR LatLng] error: null [2024-04-30 16:26:38.924468 SignalR LatLng] error: null [2024-04-30 16:26:38.925441 SignalR LatLng] error: null [2024-04-30 16:26:38.926642 SignalR LatLng] error: null [2024-04-30 16:26:38.927433 SignalR LatLng] error: null [2024-04-30 16:26:39.932434 SignalR LatLng] error: null [2024-04-30 16:26:39.933370 SignalR LatLng] error: null [2024-04-30 16:26:39.940699 SignalR LatLng] error: null [2024-04-30 16:26:39.942024 SignalR LatLng] error: null [2024-04-30 16:26:40.579387 SignalR LatLng] error: null [2024-04-30 16:26:40.580031 SignalR LatLng] error: null [2024-04-30 16:26:40.585920 SignalR LatLng] error: null [2024-04-30 16:26:40.587504 SignalR LatLng] error: null [2024-04-30 16:26:40.588408 SignalR LatLng] error: null [2024-04-30 16:26:40.588793 SignalR LatLng] error: null [2024-04-30 16:26:40.589331 SignalR LatLng] error: null [2024-04-30 16:26:40.589708 SignalR LatLng] error: null E/flutter (10329): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: WebSocketException: Connection to 'https://realtime.**********.net:0/hub?id=TjG-bT7yoDX30zDl2fjJmg&access_token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6ImY3NTZjNmJjLTEwYTQtNGE0Ny1jM2IwLTA4ZGM1Yzc2Y2Q1OCIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkRyaXZlciIsImV4cCI6MTcxNDQ5ODM2MywiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NzA4Ny8iLCJhdWQiOiJodHRwczovL2xvY2FsaG9zdDo3MDg3LyJ9.fuxYpVypm3nzA15qMwbO9wrmszNV48cpKlHom--o6A8#' was not upgraded to websocket [2024-04-30 16:26:41.300578 SignalR LatLng] error: null [2024-04-30 16:26:41.301126 SignalR LatLng] error: null [2024-04-30 16:26:41.301848 SignalR LatLng] error: null ` |
I'm using:
Exception: Unhandled Exception: WebSocketException: Connection to 'https:/xxx/hubs/main?id=5zQMxzPBiDsmCtyvURG4Gg#' was not upgraded to websocket
SignalR: Failed to start with error: The underlying connection was closed before the hub handshake could complete
This is my code:
`
SignalrBaseService(this._path, this._cookie) {
final defaultHeaders = MessageHeaders();
defaultHeaders.setHeaderValue("Origin", origin);
defaultHeaders.setHeaderValue("Cookie", 'X-AUTH-TOKEN=$_cookie');
}
Future connect() async {
try {
await _hubConnection.start();
if (isConnected) {
print('SignalR: Connected to the server: $_basePath/$_path');
}
} catch (err) {
print('SignalR: Failed to start with error: $err');
}
}
`
Cookie/origin are there for a custom cookie authorization scheme. Tracking this in debugger proves that backend authorizes correctly. But I always get this message.
If i remove authorize attributes from the Hub - it will connect without issue.
Also, using wscat I'm able to easily connect with/without authorize.
Also, connecting to the same hub from android app, 2x angular apps.
The text was updated successfully, but these errors were encountered: