Last post Jan 09, 2017 06:08 AM by Zhi Lv - MSFT
Jan 06, 2017 01:57 PM|patrickschlueer|LINK
Hey, maybe someone here can help me. I am trying to use SignalR in my Angular 2 Project with WebSockets.
I enabled the CORS and everything for my API and added the OnDisconnected method in my hub. If I start my web application with Firefox, I can connect to it without any problems and when I close the tab, it instantly calls the OnDisconnected method and I
can open the application and connect again without problems. But when I use Google Chrome, I can only connect without problems the very first time after the Server restarted. After that, when I close the tab, it doesn't call the OnDisconnected method until
it gets automatically called after 35 seconds. After that time, I can connect again. But when I try to connect withing these 35 seconds, I can not connect to it anymore with a 500 Error. After that, it feels like I can never connect ever again.
When I try to call the .stop() Method in my Frontend in Google Chrome (attached to an event which is triggered on switching my 'view') it doesn't call the OnDisconnected() method either. In Firefox this is also no problem.
All I can see is a "No 'Access-Control-Allow-Origin' header is present on the requested resource" during "localhost/signalr/abort?..." in Google Chrome and then it will give an "Error during WebSocket handshake: Unexpected response code: 500" when it tries
Does anyone know what this problem could be? Thanks
Jan 09, 2017 06:08 AM|Zhi Lv - MSFT|LINK
"Error during WebSocket handshake: Unexpected response code: 500
As for this issue, I suggest you could check this threads and try to use
Web Sockets Secure: