diff --git a/view/main.js b/view/main.js index beddbed..df45fa3 100755 --- a/view/main.js +++ b/view/main.js @@ -91,6 +91,6 @@ window.wsc_chat = window.wsc.channel('chat').listen(function(msg, err){ /* (4) Clean sockets before page quit ---------------------------------------------------------*/ window.onbeforeunload = function() { - window.wsc_chat.ws.close(); - window.wsc_connect.ws.close(); + window.wsc_chat.send('{"close": true}'); + window.wsc_connect.send('{"close": true}'); }; \ No newline at end of file