From ce11773865ed6f90d2e854f7d0b4db2ea7f2b2ca Mon Sep 17 00:00:00 2001 From: dupengcheng Date: Tue, 4 Aug 2020 10:44:16 +0800 Subject: [PATCH] webconsole support wss (#1401) --- tunnel-server/src/main/resources/static/web-console.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tunnel-server/src/main/resources/static/web-console.js b/tunnel-server/src/main/resources/static/web-console.js index 02aa5d3fb..d10d9fb73 100644 --- a/tunnel-server/src/main/resources/static/web-console.js +++ b/tunnel-server/src/main/resources/static/web-console.js @@ -78,7 +78,8 @@ function getTerminalSize () { /** init websocket **/ function initWs (ip, port, agentId) { - var path = 'ws://' + ip + ':' + port + '/ws?method=connectArthas&id=' + agentId; + var protocol= location.protocol === 'https:' ? 'wss://' : 'ws://'; + var path = protocol + ip + ':' + port + '/ws?method=connectArthas&id=' + agentId; ws = new WebSocket(path); }