mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-06-28 06:25:12 +00:00
Do not hardcode WebSocket URL
This commit is contained in:
@ -31,7 +31,7 @@ export class WebSocketService {
|
|||||||
// observer subscribes. This socket is shared with subsequent observers
|
// observer subscribes. This socket is shared with subsequent observers
|
||||||
// and closed when the observer count falls to zero.
|
// and closed when the observer count falls to zero.
|
||||||
this.downlink = jsonWebsocketConnect(
|
this.downlink = jsonWebsocketConnect(
|
||||||
'ws://localhost:4242/ws',
|
'ws://' + window.location.host + '/ws',
|
||||||
this.uplink = new QueueingSubject<object>()
|
this.uplink = new QueueingSubject<object>()
|
||||||
).messages.pipe(
|
).messages.pipe(
|
||||||
map(message => <WSMessage<undefined>> message),
|
map(message => <WSMessage<undefined>> message),
|
||||||
|
Reference in New Issue
Block a user