We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2968076 commit 2ee3557Copy full SHA for 2ee3557
1 file changed
libs/shared/data-access/websocket/src/service.ts
@@ -17,11 +17,16 @@ export class SocketService {
17
18
public init(token: string, onConnect: () => void, onDisconnect: () => void): void {
19
if (this._socket) return;
20
+ const apiUrl = getApiUrl();
21
22
this._socket = io(getApiUrl(), {
23
path: webSocketConfig.path,
24
transports: webSocketConfig.transports,
25
auth: { token },
26
+ // NOTE: Workaround required for the socket to connect to the backend, which rejects WS connections without this header.
27
+ extraHeaders: {
28
+ Origin: apiUrl,
29
+ },
30
});
31
32
this._socket.on(SocketState.CONNECT, () => {
0 commit comments