auto get domain

This commit is contained in:
Cai
2025-10-26 21:39:49 +08:00
parent 9921848d9b
commit b921bda4bc
2 changed files with 6 additions and 6 deletions

View File

@@ -57,12 +57,10 @@ function ChangeWorkspacefileTree(fileTree) {
} }
} }
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
// vscode.window.showInformationMessage('Connecting to server...'); const host = window.location.host;
vs_socket = io(`${protocol}//${host}/vscode`);
vs_socket = io('vscode');
vs_socket.on('connect', () => { vs_socket.on('connect', () => {
// vscode.window.showInformationMessage('Connected to server');
console.log('Connected to server'); console.log('Connected to server');
vs_socket.emit('login', { config: code_like_config }); vs_socket.emit('login', { config: code_like_config });
vs_socket.emit('load_chapter',{config: code_like_config}) vs_socket.emit('load_chapter',{config: code_like_config})

View File

@@ -24,7 +24,9 @@
}); });
}); });
socket = io('vsc-like',{path:'/vsc-like-ws'}); const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = window.location.host;
socket = io(`${protocol}//${host}/vsc-like`, { path: '/vsc-like-ws' });
const status = document.getElementById("status") const status = document.getElementById("status")
socket.on("pty_output", function(data){ socket.on("pty_output", function(data){