CORS implemented in a static manner: unable to configure on another machine
This commit is contained in:
@@ -14,7 +14,8 @@ class WebSocketService {
|
||||
|
||||
this.currentSessionId = sessionId;
|
||||
this.currentClientId = clientId;
|
||||
const wsUrl = `ws://localhost:8000/sessions/${sessionId}`;
|
||||
const apiUrl = process.env.REACT_APP_API_URL || 'ws://localhost:8000';
|
||||
const wsUrl = `${apiUrl.replace(/^http/, 'ws')}/sessions/${sessionId}`;
|
||||
this.ws = new WebSocket(wsUrl);
|
||||
|
||||
this.ws.onopen = () => {
|
||||
|
||||
Reference in New Issue
Block a user