We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44930fb commit 5458d6aCopy full SHA for 5458d6a
2 files changed
WEBHOOK_SYSTEM.md
apps/container-engine-frontend/src/services/websocket.ts
@@ -51,7 +51,8 @@ class WebSocketService {
51
try {
52
this.isConnecting = true;
53
// Backend WebSocket URL - backend runs on port 3000
54
- const wsUrl = `ws://localhost:3000/v1/ws/notifications?token=${encodeURIComponent(token)}`;
+ const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
55
+ const wsUrl = `${wsProtocol}//${window.location.host}/v1/ws/notifications?token=${encodeURIComponent(token)}`;
56
console.log('Connecting to WebSocket:', wsUrl);
57
this.ws = new WebSocket(wsUrl);
58
0 commit comments