Changes to connection system to support docker

This commit is contained in:
Karmaa
2025-03-12 20:07:39 -05:00
parent 615c8d4ceb
commit 994de92451
3 changed files with 8 additions and 9 deletions

View File

@@ -63,10 +63,10 @@ export const NewTerminal = forwardRef(({ hostConfig, isVisible }, ref) => {
const socket = io(
window.location.hostname === "localhost"
? "http://localhost:8081/ssh.io"
: "/ssh.io",
? "http://localhost:8081" // Modified path here
: "/",
{
path: "/ssh.io/socket.io",
path: "/ssh.io/socket.io", // Same path, no need to modify
transports: ["websocket", "polling"],
}
);
@@ -177,4 +177,4 @@ NewTerminal.propTypes = {
port: PropTypes.string.isRequired,
}).isRequired,
isVisible: PropTypes.bool.isRequired,
};
};

View File

@@ -4,9 +4,9 @@ const SSHClient = require("ssh2").Client;
const server = http.createServer();
const io = socketIo(server, {
path: "/ssh.io/socket.io",
path: "/ssh.io/socket.io", // Corrected path for socket.io
cors: {
origin: "*",
origin: "*", // Temporarily set to '*' to allow all origins. Change to specific URLs if needed.
methods: ["GET", "POST"],
credentials: true
},