diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 09c4be8ba..0473e4ed8 100644 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -363,6 +363,11 @@ FW_Read($$) my $len = (ord(substr($hash->{BUF},1,1)) & 0x7F); my $i = 2; + if($op == 8) { + TcpServer_Close($hash, 1); + return; + } + if( $len == 126 ) { $len = unpack( 'n', substr($hash->{BUF},$i,2) ); $i += 2; diff --git a/fhem/www/pgm2/console.js b/fhem/www/pgm2/console.js index ac58b9f9a..de4a809f3 100644 --- a/fhem/www/pgm2/console.js +++ b/fhem/www/pgm2/console.js @@ -84,8 +84,12 @@ consFill() var loc = (""+location).replace(/\?.*/,""); if($("body").attr("longpoll") == "websocket") { - if(consConn) + if(consConn) { + consConn.onclose = + consConn.onerror = + consConn.onmessage = undefined; consConn.close(); + } consConn = new WebSocket(loc.replace(/[&?].*/,'') .replace(/^http/i, "ws")+query); consConn.onclose =