mirror of
https://github.com/DeNNiiInc/Connect-5.git
synced 2026-04-17 20:36:00 +00:00
Fix: Use dynamic server URL for Socket.io connection (production fix)
This commit is contained in:
@@ -12,9 +12,13 @@ class MultiplayerClient {
|
||||
this.selectedBoardSize = 15; // Default board size for multiplayer
|
||||
}
|
||||
|
||||
|
||||
// Connect to server
|
||||
connect() {
|
||||
this.socket = io('http://localhost:3000');
|
||||
// Automatically detect server URL (works for both local and production)
|
||||
const serverUrl = window.location.origin;
|
||||
console.log('Connecting to server:', serverUrl);
|
||||
this.socket = io(serverUrl);
|
||||
|
||||
// Setup board size selector buttons
|
||||
document.querySelectorAll('.size-btn-mp').forEach(btn => {
|
||||
|
||||
Reference in New Issue
Block a user