set host, port, path to 8lanes server when connect

This commit is contained in:
J 2024-08-11 16:17:08 +07:00
parent 4885574357
commit a3ab9c3a4a
2 changed files with 16 additions and 3 deletions

1
app/constant.js Normal file
View File

@ -0,0 +1 @@
export const TUNNEL_SERVER = 'hope-tunnel.8lanes.co';

View File

@ -24,6 +24,7 @@ import keysyms from '../core/input/keysymdef.js';
import Keyboard from '../core/input/keyboard.js';
import RFB from '../core/rfb.js';
import * as WebUtil from './webutil.js';
import { TUNNEL_SERVER } from './constant.js';
const PAGE_TITLE = 'noVNC';
@ -900,6 +901,17 @@ const UI = {
/* ------^-------
* /CLIPBOARD
* ==============
* SEARCH_PARAMS
* ------v------*/
readParams(key) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(key);
},
/* ------^-------
* /SEARCH_PARAMS
* ==============
* CONNECTION
* ------v------*/
@ -917,9 +929,9 @@ const UI = {
return;
}
const host = UI.getSetting('host');
const port = UI.getSetting('port');
const path = UI.getSetting('path');
const host = TUNNEL_SERVER;
const port = UI.readParams('port');
const path = 'websockify';
if (typeof password === 'undefined') {
password = WebUtil.getConfigVar('password');