Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
subfuzion committed Aug 8, 2022
1 parent 6b1c88c commit 50509db
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/client/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,15 @@ async function main(): Promise<void> {
const protocol = location.protocol === "https:" ? "wss:" : "ws:";

// Can serve frontend and backend from different hosts:
// - during development (using the webpack devServer for frontend).
// - during development (using webpack devServer for frontend).
// - in production (for example, to serve frontend from CDN).
// Define PONGHOST using DefinePlugin in webpack.config.js. If it is not set,
// then assume that the host is where the frontend was served from.
// @ts-ignore (PONGHOST is declared externally in webpack config)
const host = PONGHOST ? PONGHOST : `${protocol}//${location.host}`;

// Can have multiple websocket servers.
// The client uses the websocket for the first host it can connect to.
// For example:
// Can have multiple websocket servers. The client uses the websocket for the
// first host it can connect to. For example:
// const hosts = [host, `${protocol}//${location.hostname}:8081`];
const hosts = [host];

Expand Down

0 comments on commit 50509db

Please sign in to comment.