diff --git a/other/js/websockify.js b/other/js/websockify.js index 102e4f2..5c0a0a7 100755 --- a/other/js/websockify.js +++ b/other/js/websockify.js @@ -67,11 +67,17 @@ new_client = function(client, req) { target.on('end', function() { log('target disconnected'); client.close(); + if (rs) { + rs.end('\'EOF\'];\n'); + } }); target.on('error', function() { log('target connection error'); target.end(); client.close(); + if (rs) { + rs.end('\'EOF\'];\n'); + } }); client.on('message', function(msg) {