From b1e88159b0ca4292e3bbb406909535e9dc7417da Mon Sep 17 00:00:00 2001 From: Zakary Timson Date: Mon, 14 Sep 2026 16:27:42 -0400 Subject: [PATCH] Update src/server.mjs --- src/server.mjs | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/src/server.mjs b/src/server.mjs index 887522b..d47dcc4 100644 --- a/src/server.mjs +++ b/src/server.mjs @@ -67,36 +67,13 @@ wss.on('connection', ws => { const socket = net.createConnection(VNC_PORT, VNC_HOST); - socket.on('connect', () => { - console.log(`Connected to VNC ${VNC_HOST}:${VNC_PORT}`); - }); - socket.on('data', data => { - console.log(`VNC -> browser: ${data.length} bytes`); - - if (data.length <= 64) { - console.log(` hex: ${data.toString('hex')}`); - console.log(` text: ${JSON.stringify(data.toString())}`); - } - - if (ws.readyState === ws.OPEN) { - ws.send(data, {binary: true}); - } + if (ws.readyState === ws.OPEN) ws.send(data, {binary: true}); }); ws.on('message', (data, isBinary) => { const buffer = Buffer.isBuffer(data) ? data : Buffer.from(data); - - console.log(`Browser -> VNC: ${buffer.length} bytes (${isBinary ? 'binary' : 'text'})`); - - if (buffer.length <= 64) { - console.log(` hex: ${buffer.toString('hex')}`); - console.log(` text: ${JSON.stringify(buffer.toString())}`); - } - - if (socket.writable) { - socket.write(buffer); - } + if (socket.writable) socket.write(buffer); }); ws.on('error', error => { -- 2.54.0