Changes to connection system to support docker
This commit is contained in:
@@ -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,
|
||||
};
|
||||
};
|
||||
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user