mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Use wss for web socket when using a https connection
This commit is contained in:
parent
b488c1ed7d
commit
5730ba9125
1 changed files with 2 additions and 1 deletions
|
|
@ -58,9 +58,10 @@ export class StashService {
|
||||||
const platformUrl = new URL(platform.location.origin);
|
const platformUrl = new URL(platform.location.origin);
|
||||||
platformUrl.port = platformUrl.protocol === 'https:' ? '9999' : '9998';
|
platformUrl.port = platformUrl.protocol === 'https:' ? '9999' : '9998';
|
||||||
const url = platformUrl.toString().slice(0, -1);
|
const url = platformUrl.toString().slice(0, -1);
|
||||||
|
const webSocketScheme = platformUrl.protocol === 'https:' ? 'wss' : 'ws';
|
||||||
|
|
||||||
const wsLink = new WebSocketLink({
|
const wsLink = new WebSocketLink({
|
||||||
uri: `ws://${platform.location.hostname}:${platformUrl.port}/graphql`,
|
uri: `${webSocketScheme}://${platform.location.hostname}:${platformUrl.port}/graphql`,
|
||||||
options: {
|
options: {
|
||||||
reconnect: true
|
reconnect: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue