ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.24k stars 1.62k forks source link

SignalR no connection in `ws` mode #2094

Closed mtlive closed 1 month ago

mtlive commented 1 month ago

I tried everything in documentation for using signalR in websocket mode but couldn't get it to work. In our staging servers I get the "Handshake was canceled error" and in debug it takes so long that it switches out from ws.

Expected Behavior

Actual Behavior

image

Specifications

Also added services.AddSignalR(); Confiuration:

"Routes": [
   {
     "DownstreamHostAndPorts": [
       {
         "Host": "192.168.10.209",
         "Port": 5003
       }
     ],
     "DownstreamPathTemplate": "/{everything}",
     "DownstreamScheme": "ws",
     "UpstreamPathTemplate": "/chat/{everything}",
   },
],
"DynamicRoutes": [],
"Aggregates": [],
"GlobalConfiguration": {
  "RequestIdKey": null,
  "ServiceDiscoveryProvider": {
    "Scheme": null,
    "Host": null,
    "Port": 0,
    "Type": null,
    "Token": null,
    "ConfigurationKey": null,
    "PollingInterval": 0,
    "Namespace": null
  },
  }
}
raman-m commented 1 month ago

I believe this isn't an Ocelot issue, so I'll turn it into a discussion... Other developers have been utilizing Ocelot's SignalR feature for years.