https://github.com/dkj/polypongon
https://github.com/dkj/polypongon
ai-generated-code arcade-game game multiplayer pong pong-game pwa-app
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dkj/polypongon
- Owner: dkj
- License: agpl-3.0
- Created: 2025-12-14T17:58:41.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-02-08T18:21:51.000Z (about 2 months ago)
- Last Synced: 2026-02-09T00:32:20.676Z (about 2 months ago)
- Topics: ai-generated-code, arcade-game, game, multiplayer, pong, pong-game, pwa-app
- Language: JavaScript
- Homepage: https://polypongon.uk
- Size: 1.05 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README_INSTANCE_AFFINITY.md
- License: LICENSE
- Agents: Agents.md
Awesome Lists containing this project
README
## 🚀 Fly.io Instance Affinity
Polypongon implements **instance-specific routing** to ensure all players in a multiplayer room connect to the same Fly.io machine, guaranteeing consistent game state.
### How It Works
When you create a room, the instance ID is encoded in the shareable URL:
```
https://polypongon.fly.dev/?room=XY4Z&instance=abc123
```
When anyone joins using this URL:
1. Their browser connects with the instance parameter
2. Fly's proxy routes the WebSocket to the correct instance using `fly-replay`
3. All players see the same game state
### Benefits
✅ **Reliable Multiplayer** - No split-brain scenarios
✅ **Seamless Sharing** - URLs work across all devices
✅ **Automatic Routing** - Fly handles instance redirection
✅ **Local Development** - Works on localhost without changes
### Development
The instance affinity works automatically:
- **On Fly.io**: Instance routing is enforced
- **Locally**: Works normally without enforcement (instance = "local")
See [`FLY_INSTANCE_AFFINITY.md`](./FLY_INSTANCE_AFFINITY.md) for technical details.