Updated nginx and connection to support local and docker runtime
This commit is contained in:
@@ -19,8 +19,8 @@ http {
|
|||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Proxy WebSocket requests
|
# Proxy IO requests
|
||||||
location /io/ {
|
location /socket.io/ {
|
||||||
proxy_pass http://localhost:8081;
|
proxy_pass http://localhost:8081;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
|||||||
@@ -70,7 +70,11 @@ export function NewTerminal({ hostConfig }) {
|
|||||||
// Create socket connection
|
// Create socket connection
|
||||||
const isSecure = window.location.protocol === "https:";
|
const isSecure = window.location.protocol === "https:";
|
||||||
const wsProtocol = isSecure ? "https" : "http";
|
const wsProtocol = isSecure ? "https" : "http";
|
||||||
const ioUrl = `${wsProtocol}://${window.location.host}/io/`;
|
let ioUrl = `${wsProtocol}://${window.location.host}/socket.io/`;
|
||||||
|
|
||||||
|
if(window.location.hostname === "localhost") {
|
||||||
|
ioUrl = "http://localhost:8081";
|
||||||
|
}
|
||||||
|
|
||||||
const socket = io(ioUrl);
|
const socket = io(ioUrl);
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ io.on("connection", (socket) => {
|
|||||||
console.log("New socket connection established");
|
console.log("New socket connection established");
|
||||||
|
|
||||||
let stream = null;
|
let stream = null;
|
||||||
let currentCols = 80;
|
|
||||||
let currentRows = 24;
|
|
||||||
|
|
||||||
socket.on("connectToHost", (cols, rows, hostConfig) => {
|
socket.on("connectToHost", (cols, rows, hostConfig) => {
|
||||||
if (!hostConfig || !hostConfig.ip || !hostConfig.user || !hostConfig.password || !hostConfig.port) {
|
if (!hostConfig || !hostConfig.ip || !hostConfig.user || !hostConfig.password || !hostConfig.port) {
|
||||||
|
|||||||
Reference in New Issue
Block a user