VNC setup

This commit is contained in:
2026-09-15 00:36:20 -04:00
parent 6f83981242
commit 4c8e18b682
4 changed files with 439 additions and 32 deletions
+7 -2
View File
@@ -5,13 +5,18 @@ import { fileURLToPath } from 'node:url';
import { registerSocket } from './websocket.mjs';
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 VNC_HOST = process.env.VNC_HOST || '127.0.0.1';
const VNC_PORT = process.env.VNC_PORT || 5900;
export const vncRouter = express.Router();
vncRouter.get('/novnc/desktop.html', (req, res) =>
res.sendFile(path.join(__dirname, '../../public/desktop.html'))
);
vncRouter.use('/novnc', express.static(NOVNC));
vncRouter.get('/', (req, res) => res.sendFile(path.join(__dirname, '../public/vnc.html')));
vncRouter.get('/', (req, res) =>
res.redirect('/vnc/novnc/vnc.html?path=ws/vnc&autoconnect=true&resize=scale')
);
// Namespaced so other websocket features can register alongside this one
const wss = registerSocket('/ws/vnc', {