Skip to content

Commit

Permalink
#6 add pat support to iframe to automate setting websockify endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
thelamer committed Feb 14, 2024
1 parent 400db19 commit 76a2776
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ var PASSWORD = process.env.PASSWORD || 'abc';
var SUBFOLDER = process.env.SUBFOLDER || '/';
var TITLE = process.env.TITLE || 'KasmVNC Client';
var FM_HOME = process.env.FM_HOME || '/config';

var PATH;
if (SUBFOLDER != '/') {
PATH = '&path=' + SUBFOLDER + 'websockify'
} else {
PATH = false;
}
//// Application Variables ////
var socketIO = require('socket.io');
var express = require('express');
Expand All @@ -33,7 +38,7 @@ app.engine('json', require('ejs').renderFile);
baseRouter.use('/public', express.static(__dirname + '/public'));
baseRouter.use('/vnc', express.static("/usr/share/kasmvnc/www/"));
baseRouter.get('/', function (req, res) {
res.render(__dirname + '/public/index.html', {title: TITLE});
res.render(__dirname + '/public/index.html', {title: TITLE, path: PATH});
});
baseRouter.get('/favicon.ico', function (req, res) {
res.sendFile(__dirname + '/public/favicon.ico');
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</head>
<body>
<!--KasmVNC Iframe-->
<iframe class="vnc" src="vnc/index.html?autoconnect=1&resize=remote&clipboard_up=true&clipboard_down=true&clipboard_seamless=true&show_control_bar=true"></iframe>
<iframe class="vnc" src="vnc/index.html?autoconnect=1&resize=remote&clipboard_up=true&clipboard_down=true&clipboard_seamless=true&show_control_bar=true<% if(path){ %><%- path -%><% } %>"></iframe>
<!--LSIO Function Bar-->
<div id="lsbar">
<img class="icons" id="fileButton" title="File Manager" src="public/css/files.svg" onclick="toggle('#files')"/>
Expand Down

0 comments on commit 76a2776

Please sign in to comment.