mDNS discovery
The goal is for a bandmate to join without typing anything. To get there, the app tries several routes to the leader at once.
How discovery works
When the leader starts a session:
- It resolves its own local IP address.
- It starts an HTTP server.
- It announces itself over mDNS/Bonjour as the service
_eutepio._tcp.
A device looking for a session runs two modes simultaneously:
- mDNS query — the fast path, works within seconds
- Local range scan — the fallback for networks without multicast
1 through 254 in your subnet and repeats every 2 seconds. Addresses where a leader was last seen are tried first (up to the last eight), so rejoining the same band is usually instant.Both routes run in parallel, not one after the other. If multicast is broken on your network the session is still found — just slightly slower.
Service record and ports
Service type: _eutepio._tcp
Protocol: TCP
Port: 8765
Fallback: 8766, 8767, 8768, 8769
HTTP endpoints
The leader's server exposes four endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/discover | GET | Returns session info — name, member count, whether a password is set |
/join | POST | Member joins, password is verified, identity is assigned |
/ws | GET | Upgrade to the WebSocket that carries all session traffic |
/health | GET | Quick check that the leader is still alive |
Other ways to connect
QR code
The leader shows a QR code holding a link of the form:
eutepio://join?ip=192.168.0.42&port=8765&pin=1234&session=…&leader=…
The member scans it with the built-in reader and connects directly — no waiting for discovery. Useful in venues where the network is crowded or multicast is blocked.
Manual IP address
The session list has an option to type an address by hand. The leader shows its IP on the sync screen.
Session password
/join call; without the right password the member never reaches the WebSocket. The PIN is part of the QR code, so scanning skips typing it.Network requirements
| Condition | Why |
|---|---|
| Same local network / subnet | Both the scan and mDNS only work inside your network segment |
| Multicast allowed | Required for the fast mDNS path |
| Client isolation off | Many hotel and venue WiFi networks forbid device-to-device traffic |
| VPN off | A VPN routes traffic away from the local network |
iOS permission
_eutepio._tcp service and the prompt text in the project; the dialog appears on the first discovery attempt.Android permission
Troubleshooting
The session does not show up on the other device
- Check that both devices are on the same network — not one on WiFi and the other on mobile data.
- Check whether the network has client isolation enabled (typical for public and hotel WiFi).
- Turn off VPN on both devices.
- Try the QR code or manual IP — both skip discovery entirely.
- If nothing helps, turn one phone into a hotspot and join through it.
The local-network dialog never appeared on iOS
The connection drops while playing
The leader came up on a different port
That is normal behaviour when 8765 is taken. Discovery and the scan both account for it, but a manually typed address cannot guess the port — use the QR code in that situation.