Socket.io Connection to ws: // was interrupted during page load

I don’t know why, but I still get this error on my website (hosted on nodejitsu.com). If I test the project on the local host, everything goes well, but if I open it in the browser, this error will appear.

I was looking for this problem, but I did not find anything useful.

+5
source share
1 answer

This is the trick:

$(window).on('beforeunload', function(){
    socket.close();
});
0
source

All Articles