Skip to content

Commit 41d8675

Browse files
committed
feat: Simplify WebSocket URL generation for LAN games
1 parent 75eb582 commit 41d8675

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

client/js/managers/network-manager.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ export class NetworkManager {
1010
}
1111

1212
getWebSocketUrl(serverAddress, path = '/game') {
13-
const isSecure = window.location.protocol === 'https:';
14-
const protocol = isSecure ? 'wss:' : 'ws:';
15-
const port = isSecure ? '' : ':8080';
16-
return `${protocol}//${serverAddress}${port}${path}`;
13+
// For LAN games, always use ws:// and port 8080
14+
return `ws://${serverAddress}:8080${path}`;
1715
}
1816

1917
connectToLobby(serverAddress) {

0 commit comments

Comments
 (0)