mirror of
https://github.com/sailor-sh/CK-X.git
synced 2026-02-14 09:29:53 +00:00
force polling for terminal
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.21.2",
|
||||
"http-proxy-middleware": "^2.0.7",
|
||||
"socket.io": "^4.7.2",
|
||||
"socket.io": "4.7.2",
|
||||
"ssh2": "^1.14.0",
|
||||
"xterm": "^5.3.0"
|
||||
},
|
||||
|
||||
@@ -153,7 +153,8 @@ function connectToSocketIO() {
|
||||
socket = io('/ssh', {
|
||||
forceNew: true,
|
||||
reconnectionAttempts: 1000,
|
||||
timeout: 1000
|
||||
timeout: 1000,
|
||||
transports: ['polling'] // force polling for now to avoid invalid frame error , TODO: fix this
|
||||
});
|
||||
console.log('Creating new socket connection to SSH server');
|
||||
|
||||
@@ -199,6 +200,12 @@ function connectToSocketIO() {
|
||||
if (terminal) {
|
||||
terminal.writeln(`\r\n\x1b[1;31m[ERROR]\x1b[0m ${err.message}\r\n`);
|
||||
}
|
||||
// try to reconnect
|
||||
setTimeout(() => {
|
||||
if (socket && !socket.connected) {
|
||||
socket.connect();
|
||||
}
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
// Handle SSH data with processing for ANSI codes
|
||||
|
||||
@@ -212,7 +212,7 @@ services:
|
||||
- LOG_LEVEL=info
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- TRACK_METRICS=false # based on the environment variable TRACK_METRICS, the facilitator will send metrics to the metric server
|
||||
- TRACK_METRICS=true # based on the environment variable TRACK_METRICS, the facilitator will send metrics to the metric server
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- jumphost
|
||||
|
||||
@@ -20,23 +20,6 @@ server {
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
location /ssh/socket.io/ {
|
||||
proxy_pass http://webapp:3000/ssh/socket.io/;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
|
||||
proxy_read_timeout 86400;
|
||||
proxy_send_timeout 86400;
|
||||
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
||||
# Facilitator API endpoint
|
||||
location /facilitator/api/ {
|
||||
proxy_pass http://facilitator:3000/api/;
|
||||
|
||||
Reference in New Issue
Block a user