diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-20 00:06:17 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-20 21:10:04 +0100 |
| commit | dc54ca89f2639123a8e66ab38c6b8aeabeaf45c3 (patch) | |
| tree | e0481670d12afbd73cc64eff2e996be9816422f6 | |
| parent | e1620384089976954d80161e1a91b17b1ac75d95 (diff) | |
Need to adjust http/s as well
| -rw-r--r-- | webAO/master.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/webAO/master.ts b/webAO/master.ts index 000f816..f12674f 100644 --- a/webAO/master.ts +++ b/webAO/master.ts @@ -138,26 +138,29 @@ function getCachedServerlist(): AOServer[] { } function processServerlist(serverlist: AOServer[]) { - const clientURL: string = `${protocol}//${host}/client.html`; for (let i = 0; i < serverlist.length; i++) { const server = serverlist[i]; let port = 0; - let protocol = ''; + let ws_protocol = ''; + let http_protocol = ''; if (server.ws_port) { port = server.ws_port; - protocol = 'ws'; + ws_protocol = 'ws'; + http_protocol = 'http'; } if (server.wss_port) { port = server.wss_port; - protocol = 'wss'; + ws_protocol = 'wss'; + http_protocol = 'https'; } if (port === 0 || protocol === '') { console.warn(`Server ${server.name} has no websocket port, skipping`) continue; } - const connect = `${protocol}://${server.ip}:${port}`; + const clientURL: string = `${http_protocol}//${host}/client.html`; + const connect = `${ws_protocol}://${server.ip}:${port}`; const serverName = server.name; server.online = `Players: ${server.players}`; servers.push(server); |
