6 Commits
Author SHA1 Message Date
ztimson 279b3ff684 Merge pull request 'Update src/server.mjs' (#8) from ztimson-patch-8 into master
Reviewed-on: #8
2026-09-14 16:27:49 -04:00
ztimson b1e88159b0 Update src/server.mjs
Code review / review (pull_request) Successful in 36s
2026-09-14 16:27:42 -04:00
ztimson 8261c671af Merge pull request 'Update install.sh' (#7) from ztimson-patch-7 into master
Reviewed-on: #7
2026-09-14 16:25:14 -04:00
ztimson 22985b6230 Update install.sh
Code review / review (pull_request) Successful in 31s
2026-09-14 16:25:08 -04:00
ztimson 9b5bf5d2fb Merge pull request 'Update src/server.mjs' (#6) from ztimson-patch-6 into master
Reviewed-on: #6
2026-09-14 16:11:01 -04:00
ztimson daaa53790a Update src/server.mjs
Code review / review (pull_request) Successful in 32s
2026-09-14 16:10:55 -04:00
2 changed files with 10 additions and 26 deletions
+7
View File
@@ -7,6 +7,13 @@ curl -sL https://git.zakscode.com/ztimson/fallback-ap/raw/branch/master/install.
# VNC
sudo raspi-config nonint do_vnc 0
cat <<EOF | sudo tee /etc/wayvnc/config
use_relative_paths=true
address=127.0.0.1
enable_auth=false
enable_pam=false
relax_encryption=true
EOF
# Node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.7/install.sh | bash
+3 -26
View File
@@ -8,7 +8,7 @@ import {fileURLToPath} from 'node:url';
import {WebSocketServer} from 'ws';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const NOVNC = path.join(__dirname, 'node_modules/@novnc/novnc');
const NOVNC = path.join(__dirname, '../node_modules/@novnc/novnc');
const PORT = process.env['PORT'] || 3000;
const VNC_HOST = '127.0.0.1';
const VNC_PORT = 5900;
@@ -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 => {