server: add support for cli args via url

This commit is contained in:
Shuanglei Tao
2019-04-14 22:21:21 +08:00
parent bd8d2cfc32
commit 74e091f954
7 changed files with 54 additions and 8 deletions

View File

@@ -172,7 +172,7 @@ function handleReceive(zsession) {
var terminalContainer = document.getElementById('terminal-container'),
httpsEnabled = window.location.protocol === 'https:',
url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname
+ (window.location.pathname.endsWith('/') ? '' : '/') + 'ws',
+ (window.location.pathname.endsWith('/') ? '' : '/') + 'ws' + window.location.search,
textDecoder = new TextDecoder(),
textEncoder = new TextEncoder(),
authToken = (typeof tty_auth_token !== 'undefined') ? tty_auth_token : null,