diff options
| author | stonedDiscord <Tukz@gmx.de> | 2023-11-22 19:27:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-22 19:27:10 +0100 |
| commit | 26e3cd4bfe08a78e65935cf494c24193f59c8a7e (patch) | |
| tree | d5bc00fd748bceedb8693003916beed1f242ee3e /webAO/utils/queryParser.ts | |
| parent | 6480caf604d06778109cb58e5983d883725838a9 (diff) | |
| parent | f848f34b9979740e85b9648eb42ecafd20dd3926 (diff) | |
Merge pull request #201 from Troid-Tech/connect-to-wss
Fix https and add wss support
Diffstat (limited to 'webAO/utils/queryParser.ts')
| -rw-r--r-- | webAO/utils/queryParser.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/webAO/utils/queryParser.ts b/webAO/utils/queryParser.ts index f934ac6..1a3cea6 100644 --- a/webAO/utils/queryParser.ts +++ b/webAO/utils/queryParser.ts @@ -2,6 +2,7 @@ interface QueryParams { ip: string; + connect: string; mode: string; asset: string; theme: string; @@ -9,13 +10,15 @@ interface QueryParams { } const queryParser = (): QueryParams => { + const protocol = window.location.protocol; const urlParams = new URLSearchParams(window.location.search); const queryParams = { ip: urlParams.get("ip") || "", + connect: urlParams.get("connect") || "", mode: urlParams.get("mode") || "join", - asset: urlParams.get("asset") || "http://attorneyoffline.de/base/", + asset: urlParams.get("asset") || `${protocol}//attorneyoffline.de/base/`, theme: urlParams.get("theme") || "default", - serverName: urlParams.get("serverName") || "Attorney Online session" + serverName: urlParams.get("serverName") || "Attorney Online session", } return queryParams as QueryParams; }; |
