From 2f692da1c9d52ec93b0780dbd5151138035d5eb3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 13 Sep 2024 13:16:14 +0200 Subject: [PATCH] chore: Update WebSocket URL in terminal.blade.php --- .../views/livewire/project/shared/terminal.blade.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/project/shared/terminal.blade.php b/resources/views/livewire/project/shared/terminal.blade.php index 9fa6bbfb7..293c387e2 100644 --- a/resources/views/livewire/project/shared/terminal.blade.php +++ b/resources/views/livewire/project/shared/terminal.blade.php @@ -34,12 +34,18 @@ function initializeWebSocket() { if (!socket || socket.readyState === WebSocket.CLOSED) { + // Only use port if Coolify is used with ip (so it has a port in the url) + let postPath = ':6002/terminal'; + const port = window.location.port; + if (!port) { + postPath = '/terminal'; + } let url = window.location.hostname; // make sure the port is not included url = url.split(':')[0]; socket = new WebSocket((window.location.protocol === 'https:' ? 'wss://' : 'ws://') + url + - ':6002/terminal'); + postPath); socket.onmessage = handleSocketMessage; socket.onerror = (e) => {