Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

socket.io The connection to ws:// was interrupted while the page was loading

Tags:

socket.io

I don't know why but I am still getting this error on my website (hosted on nodejitsu.com). If am I testing project on localhost everything goes well, but if I open it in browser this error is showing..

I was searching for this issue, but I didn't find anything usefull..

like image 495
dontHaveName Avatar asked Nov 13 '22 09:11

dontHaveName


1 Answers

This does the trick:

$(window).on('beforeunload', function(){
    socket.close();
});
like image 193
Kev C Avatar answered Jan 04 '23 01:01

Kev C