Updated conection process to work hopfully with docker.
This commit is contained in:
@@ -70,14 +70,12 @@ export function NewTerminal({ hostConfig }) {
|
||||
// Write initial connection message
|
||||
terminal.write("\r\n*** Connecting to backend ***\r\n");
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
const socket = io(ioUrl);
|
||||
const socket = io(window.location.hostname === "localhost"
|
||||
? 'http://localhost:8081'
|
||||
: '/', {
|
||||
path: '/socket.io',
|
||||
transports: ['websocket', 'polling']
|
||||
});
|
||||
socketRef.current = socket;
|
||||
|
||||
socket.off("connect");
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Start the backend server
|
||||
node /app/src/backend/server.cjs &
|
||||
|
||||
# Start nginx in the foreground
|
||||
exec nginx -g 'daemon off;'
|
||||
@@ -5,9 +5,9 @@ const SSHClient = require("ssh2").Client;
|
||||
const server = http.createServer();
|
||||
const io = socketIo(server, {
|
||||
cors: {
|
||||
origin: "*", // Allow all origins
|
||||
methods: ["*"], // Allow all methods
|
||||
allowedHeaders: ["*"], // Allow all headers
|
||||
origin: "*",
|
||||
methods: ["GET", "POST"],
|
||||
credentials: true
|
||||
},
|
||||
allowEIO3: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user