From 5730ba9125de07bd55e94e1a22c46e1858a229fe Mon Sep 17 00:00:00 2001 From: Stash Dev Date: Thu, 14 Feb 2019 16:28:12 -0800 Subject: [PATCH] Use wss for web socket when using a https connection --- ui/v1/src/app/core/stash.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/v1/src/app/core/stash.service.ts b/ui/v1/src/app/core/stash.service.ts index 9e3a10d48..1ec0a789d 100644 --- a/ui/v1/src/app/core/stash.service.ts +++ b/ui/v1/src/app/core/stash.service.ts @@ -58,9 +58,10 @@ export class StashService { const platformUrl = new URL(platform.location.origin); platformUrl.port = platformUrl.protocol === 'https:' ? '9999' : '9998'; const url = platformUrl.toString().slice(0, -1); + const webSocketScheme = platformUrl.protocol === 'https:' ? 'wss' : 'ws'; const wsLink = new WebSocketLink({ - uri: `ws://${platform.location.hostname}:${platformUrl.port}/graphql`, + uri: `${webSocketScheme}://${platform.location.hostname}:${platformUrl.port}/graphql`, options: { reconnect: true }