I am trying to connect to a SignalR hub behind an Ocelot Api gateway from a React application. However, when doing so I get the following error:
Unhandled Rejection (Error):
new HttpError
index.js:1 [2021-01-31T02:42:31.498Z] Error: Failed to complete negotiation with the server: Error
index.js:1 [2021-01-31T02:42:31.498Z] Error: Failed to start the connection: Error
Uncaught (in promise) Error
at new HttpError (Errors.ts:20)
at FetchHttpClient.<anonymous> (FetchHttpClient.ts:116)
at step (FetchHttpClient.ts:2)
at Object.next (FetchHttpClient.ts:2)
at fulfilled (FetchHttpClient.ts:2)
I have read Ocelot's documentation on SignalR/WS (https://ocelot.readthedocs.io/en/latest/features/websockets.html) and also made sure that requests are being routed as they should in my ocelot.json:
{
"DownstreamPathTemplate": "/notificationhub",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 7001
}
],
"UpstreamPathTemplate": "/notifications",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ]
},
What is wrong?