diff --git a/app/Models/Server.php b/app/Models/Server.php index 1f173604de..3a11c2206c 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -310,7 +310,7 @@ public function setupDynamicProxyConfiguration() 0 => 'http', ], 'service' => 'coolify-terminal', - 'rule' => "Host(`{$host}`) && PathPrefix(`/terminal`)", + 'rule' => "Host(`{$host}`) && PathPrefix(`/terminal/ws`)", ], ], 'services' => [ @@ -375,7 +375,7 @@ public function setupDynamicProxyConfiguration() 0 => 'https', ], 'service' => 'coolify-terminal', - 'rule' => "Host(`{$host}`) && PathPrefix(`/terminal`)", + 'rule' => "Host(`{$host}`) && PathPrefix(`/terminal/ws`)", 'tls' => [ 'certresolver' => 'letsencrypt', ], @@ -413,7 +413,7 @@ public function setupDynamicProxyConfiguration() handle /app/* { reverse_proxy coolify-realtime:6001 } - handle /terminal/* { + handle /terminal/ws/* { reverse_proxy coolify-realtime:6002 } reverse_proxy coolify:80 diff --git a/docker/coolify-realtime/terminal-server.js b/docker/coolify-realtime/terminal-server.js index 787cb80bc6..daa09a6f8e 100755 --- a/docker/coolify-realtime/terminal-server.js +++ b/docker/coolify-realtime/terminal-server.js @@ -17,8 +17,8 @@ const server = http.createServer((req, res) => { const verifyClient = async (info, callback) => { const cookies = cookie.parse(info.req.headers.cookie || ''); - const origin = new URL(info.origin); - const protocol = origin.protocol; + // const origin = new URL(info.origin); + // const protocol = origin.protocol; const xsrfToken = cookies['XSRF-TOKEN']; // Generate session cookie name based on APP_NAME @@ -53,7 +53,7 @@ const verifyClient = async (info, callback) => { }; -const wss = new WebSocketServer({ server, path: '/terminal', verifyClient: verifyClient }); +const wss = new WebSocketServer({ server, path: '/terminal/ws', verifyClient: verifyClient }); const userSessions = new Map(); wss.on('connection', (ws) => { diff --git a/resources/js/app.js b/resources/js/app.js index f450cbe293..bbf8104c6b 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -14,7 +14,7 @@ if (!window.term) { cols: 80, rows: 30, fontFamily: '"Fira Code", courier-new, courier, monospace, "Powerline Extra Symbols"', - cursorBlink: true + cursorBlink: true, }); window.fitAddon = new FitAddon(); window.term.loadAddon(window.fitAddon); diff --git a/resources/views/livewire/project/shared/terminal.blade.php b/resources/views/livewire/project/shared/terminal.blade.php index 293c387e28..d12360ce99 100644 --- a/resources/views/livewire/project/shared/terminal.blade.php +++ b/resources/views/livewire/project/shared/terminal.blade.php @@ -1,18 +1,18 @@
-
-
+ {{--
+
-
+
--}}
-