From 08dbfdaf8fda303f003ff0d202356e0ea25ec15b Mon Sep 17 00:00:00 2001 From: Karmaa Date: Sat, 22 Feb 2025 01:40:45 -0600 Subject: [PATCH] Attempt #7 to fix CORS issue and docker build. --- src/Terminal.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Terminal.jsx b/src/Terminal.jsx index 4c1052ae..68802063 100644 --- a/src/Terminal.jsx +++ b/src/Terminal.jsx @@ -69,8 +69,10 @@ export function NewTerminal({ hostConfig }) { terminal.write("\r\n*** Connecting to backend ***\r\n"); // Create socket connection - const isSecure = window.location.protocol === "https:"; - let ioUrl = `${isSecure ? "https" : "http"}://${window.location.hostname}:${window.location.port}/socket.io/`; + //const isSecure = window.location.protocol === "https:"; + //let ioUrl = `${isSecure ? "https" : "http"}://${window.location.hostname}:${window.location.port}/socket.io/`; + const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + let ioUrl = `${protocol}//${window.location.hostname}:${window.location.port}/socket.io/`; if (window.location.hostname === "localhost") { ioUrl = "http://localhost:8081";