Changes to connection system to support docker

This commit is contained in:
Karmaa
2025-03-12 18:02:39 -05:00
parent f7cdeb94f7
commit bd79e1e5c3
4 changed files with 15 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ http {
} }
# Proxy SSH socket requests # Proxy SSH socket requests
location /ssh-socket.io/ { location /ssh.io/ {
proxy_pass http://127.0.0.1:8081; proxy_pass http://127.0.0.1:8081;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
@@ -30,7 +30,7 @@ http {
} }
# Proxy database requests # Proxy database requests
location /database-socket.io/ { location /database.io/ {
proxy_pass http://127.0.0.1:8082; proxy_pass http://127.0.0.1:8082;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;

View File

@@ -371,6 +371,15 @@ function App() {
/> />
{isLaunchpadOpen && <Launchpad onClose={() => setIsLaunchpadOpen(false)} />} {isLaunchpadOpen && <Launchpad onClose={() => setIsLaunchpadOpen(false)} />}
<LoginUserModal
isHidden={isLoginUserHidden}
form={loginUserForm}
setForm={setLoginUserForm}
handleLoginUser={handleLoginUser}
setIsLoginUserHidden={setIsLoginUserHidden}
setIsCreateUserHidden={setIsCreateUserHidden}
/>
{/* User component */} {/* User component */}
<User <User
ref={userRef} ref={userRef}

View File

@@ -66,7 +66,7 @@ export const NewTerminal = forwardRef(({ hostConfig, isVisible }, ref) => {
? "http://localhost:8081" ? "http://localhost:8081"
: "/", : "/",
{ {
path: "/ssh-socket.io/", path: "/ssh.io/",
transports: ["websocket", "polling"], transports: ["websocket", "polling"],
} }
); );

View File

@@ -2,15 +2,15 @@ import { useRef, forwardRef, useImperativeHandle } from "react";
import io from "socket.io-client"; import io from "socket.io-client";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
let socket = null; let socket;
if (socket === null) { if (!socket) {
socket = io( socket = io(
window.location.hostname === "localhost" window.location.hostname === "localhost"
? "http://localhost:8082" ? "http://localhost:8082"
: "/", : "/",
{ {
path: window.location.hostname === "localhost" ? "/" : "/database-socket.io/", path: "/database.io",
transports: ["websocket", "polling"], transports: ["websocket", "polling"],
} }
); );