From b71b7780bb16606a9d6636b4e0bd080247c46313 Mon Sep 17 00:00:00 2001 From: "Aaron C. de Bruyn" Date: Tue, 16 May 2017 20:34:39 -0700 Subject: [PATCH] Include end-of-file marker --- other/js/websockify.js | 6 ++++++ 1 file changed, 6 insertions(+) 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) {