There was an error while loading. Please reload this page.
1 parent 8cdd26e commit deec831Copy full SHA for deec831
netplayjs-client/src/matchmaking/client.ts
@@ -16,9 +16,9 @@ export const DEFAULT_SERVER_URL = "https://netplayjs.varunramesh.net";
16
function getWebSocketURL(serverURL: string): string {
17
const url = new URL(serverURL);
18
if (url.protocol === "http:") {
19
- return `ws://${url.hostname}/`;
+ return `ws://${url.hostname}:${url.port}/`;
20
} else if (url.protocol === "https:") {
21
- return `wss://${url.hostname}/`;
+ return `wss://${url.hostname}:${url.port}/`;
22
} else {
23
throw new Error(`Unknown protocol: ${url.protocol}`);
24
}
0 commit comments