Skip to content

Commit 5458d6a

Browse files
author
secus
committed
Update WebSocket URL to use appropriate protocol
1 parent 44930fb commit 5458d6a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

WEBHOOK_SYSTEM.md

Whitespace-only changes.

apps/container-engine-frontend/src/services/websocket.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class WebSocketService {
5151
try {
5252
this.isConnecting = true;
5353
// Backend WebSocket URL - backend runs on port 3000
54-
const wsUrl = `ws://localhost:3000/v1/ws/notifications?token=${encodeURIComponent(token)}`;
54+
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
55+
const wsUrl = `${wsProtocol}//${window.location.host}/v1/ws/notifications?token=${encodeURIComponent(token)}`;
5556
console.log('Connecting to WebSocket:', wsUrl);
5657
this.ws = new WebSocket(wsUrl);
5758

0 commit comments

Comments
 (0)