Getting Started¶
Quick guide to get Signal Fish Server running and connect your first client.
Installation¶
Using Rust¶
The server starts on port 3536 by default.
Using Docker¶
Using Docker Compose¶
First Connection¶
Connect your WebSocket client to:
Basic Client Flow¶
Here's a minimal example showing a complete session:
JavaScript
const ws = new WebSocket('ws://localhost:3536/v2/ws');
ws.onopen = () => {
// Create a room by joining without a room code
ws.send(JSON.stringify({
type: 'JoinRoom',
data: {
game_name: 'my-game',
player_name: 'Player1',
max_players: 4
}
}));
};
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
if (message.type === 'RoomJoined') {
console.log('Room code:', message.data.room_code);
// Share this code with other players
}
if (message.type === 'PlayerJoined') {
console.log('Player joined:', message.data.player.name);
}
if (message.type === 'GameData') {
console.log('Received game data:', message.data.data);
}
};
Joining an Existing Room¶
JavaScript
ws.send(JSON.stringify({
type: 'JoinRoom',
data: {
game_name: 'my-game',
room_code: 'ABC123',
player_name: 'Player2'
}
}));
Sending Game Data¶
Health Check¶
Verify the server is running:
Next Steps¶
- Configuration - Customize server settings
- Protocol Reference - Complete message documentation
- Authentication - Secure your server