Skip to content

Commit 2dbd73c

Browse files
committed
sticky
1 parent 6fa9bf6 commit 2dbd73c

File tree

6 files changed

+6
-2
lines changed

6 files changed

+6
-2
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<script>
5858
window.GIT_COMMIT = <%- gitCommit %>;
5959
window.ASSET_MANIFEST = <%- assetManifest %>;
60+
window.WS_URL = <%- wsUrl %>;
6061
window.BOOTSTRAP_CONFIG = {
6162
gameEnv: <%- gameEnv %>,
6263
};

src/client/LobbySocket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class PublicLobbySocket {
5454
}
5555

5656
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
57-
const wsUrl = `${protocol}//${window.location.host}${this.workerPath}/lobbies`;
57+
const wsUrl = `${protocol}//${window.WS_URL}/${this.workerPath}/lobbies`;
5858

5959
this.ws = new WebSocket(wsUrl);
6060
this.wsAttemptCounted = false;

src/client/Main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ function updateAccountNavButton(userMeResponse: UserMeResponse | false) {
163163
declare global {
164164
interface Window {
165165
GIT_COMMIT: string;
166+
WS_URL: string;
166167
turnstile: any;
167168
adsEnabled: boolean;
168169
PageOS: {

src/client/Transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export class Transport {
324324
) {
325325
this.startPing();
326326
this.killExistingSocket();
327-
const wsHost = window.location.host;
327+
const wsHost = window.WS_URL;
328328
const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:";
329329
const workerPath = this.lobbyConfig.serverConfig.workerPath(
330330
this.lobbyConfig.gameID,

src/server/RenderHtml.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export async function renderHtmlContent(htmlPath: string): Promise<string> {
2626
backgroundImageUrl: buildAssetUrl("images/background.webp", assetManifest),
2727
desktopLogoImageUrl: buildAssetUrl("images/OpenFront.webp", assetManifest),
2828
mobileLogoImageUrl: buildAssetUrl("images/OF.webp", assetManifest),
29+
wsUrl: JSON.stringify(`${process.env.SUBDOMAIN}.${process.env.DOMAIN}`),
2930
});
3031
}
3132

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export default defineConfig(({ mode }) => {
101101
inject: {
102102
data: {
103103
gitCommit: JSON.stringify("DEV"),
104+
wsUrl: JSON.stringify("localhost:9000"),
104105
...htmlAssetData,
105106
},
106107
},

0 commit comments

Comments
 (0)