I'm setting up a signalr connection from my angular front-end to a Asp.Net Core back-end. With fiddler i see multiple calls when starting the connection. The first call isn't completing which is a problem for our e2e tests.
I tried set SkipNegotiation: true, transport: SignalR.HttpTransportType.WebSockets but then the connection can't be established anymore because of a missing Connection ID
this.hubConnection = new signalR.HubConnectionBuilder()
.configureLogging(signalR.LogLevel.Information)
.withUrl('/api/notificationHub', {
// skipNegotiation: true, transport:
signalR.HttpTransportType.WebSockets
}).build();
this.hubConnection.start().then((x) => {
console.log(x);
}).catch((x) => {
console.log(x);
});
I expect all calls to complete. but the actual situation is that the first call doesn't complete (or it takes a very long time)
GET http://localhost:4200/api/notificationHub?id=BHSyLOnn5BfBbaFYQ7qboQ
--Raw request of first call
GET http://localhost:4200/api/notificationHub?id=cm1MjKA22om6orpWoDcO3Q HTTP/1.1 Host: localhost:4200 Connection: keep-alive Accept: text/event-stream Cache-Control: no-cache User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36 Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin Referer: http://localhost:4200/ Accept-Encoding: gzip, deflate, br Accept-Language: nl,en-US;q=0.9,en;q=0.8,nl-NL;q=0.7
--Raw request of second call
POST http://localhost:4200/api/notificationHub?id=BHSyLOnn5BfBbaFYQ7qboQ HTTP/1.1 Host: localhost:4200 Connection: keep-alive Content-Length: 32 Sec-Fetch-Mode: cors Origin: http://localhost:4200 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36 Content-Type: text/plain;charset=UTF-8 Accept: / Sec-Fetch-Site: same-origin Referer: http://localhost:4200/ Accept-Encoding: gzip, deflate, br Accept-Language: nl,en-US;q=0.9,en;q=0.8,nl-NL;q=0.7
{"protocol":"json","version":1}
OPTION calls
– Iftifar Taz