diff options
author | Kristóf Marussy <kristof@marussy.com> | 2023-09-04 18:08:59 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2023-09-04 20:33:55 +0200 |
commit | 0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6 (patch) | |
tree | 3df27544768e96ec8508452d07b9c20c30f374b0 /subprojects/frontend/src/xtext/XtextWebSocketClient.ts | |
parent | refactor(frontend): graph visualizer performance (diff) | |
download | refinery-0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6.tar.gz refinery-0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6.tar.zst refinery-0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6.zip |
refactor: server environemntal variables
* Prefix each variable with REFINERY_
* If not public host is specified, allow all origings and compute the WebSocket
address on the client from the origin.
Diffstat (limited to 'subprojects/frontend/src/xtext/XtextWebSocketClient.ts')
-rw-r--r-- | subprojects/frontend/src/xtext/XtextWebSocketClient.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/subprojects/frontend/src/xtext/XtextWebSocketClient.ts b/subprojects/frontend/src/xtext/XtextWebSocketClient.ts index 6bb7eec8..963c1d4c 100644 --- a/subprojects/frontend/src/xtext/XtextWebSocketClient.ts +++ b/subprojects/frontend/src/xtext/XtextWebSocketClient.ts | |||
@@ -282,7 +282,10 @@ export default class XtextWebSocketClient { | |||
282 | log.debug('Creating WebSocket'); | 282 | log.debug('Creating WebSocket'); |
283 | 283 | ||
284 | (async () => { | 284 | (async () => { |
285 | const { webSocketURL } = await fetchBackendConfig(); | 285 | let { webSocketURL } = await fetchBackendConfig(); |
286 | if (webSocketURL === undefined) { | ||
287 | webSocketURL = `${window.origin.replace(/^http/, 'ws')}/xtext-service`; | ||
288 | } | ||
286 | this.openWebSocketWithURL(webSocketURL); | 289 | this.openWebSocketWithURL(webSocketURL); |
287 | })().catch((error) => { | 290 | })().catch((error) => { |
288 | log.error('Error while initializing connection', error); | 291 | log.error('Error while initializing connection', error); |