I’m encountering a problem when hosting a lobby from a user behind a VPN.
In this case, other players trying to network.join(lobbyCode) hang indefinitely — no connected event, no error, and no feedback to the app.
Debugging through chrome://webrtc-internals/, I observed:
- Multiple
icecandidateerror events occur (STUN discovery failures).
- No usable ICE candidates (
addIceCandidate) are generated.
- As a result, the connection setup cannot proceed, and
iceconnectionstatechange never fires.
Cause:
- When the host cannot gather any usable ICE candidates (e.g., public IP discovery fails due to VPN blocking STUN), connection establishment is impossible.
- Netlib doesn't appear to detect this failure case or emit any events to let the app know.
Impact:
- Players joining a VPN-hosted lobby are stuck waiting forever, without any error or feedback.
- The app cannot detect that the lobby is unreachable or retry automatically.
Suggestion:
- Detect when ICE gathering results in no candidates (or ICE connection stays in 'new' state too long).
- Emit an
error event or a failed connection state after a timeout.
- Additionally, consider allowing TURN server configuration for better support of VPN and NAT cases.
I’m encountering a problem when hosting a lobby from a user behind a VPN.
In this case, other players trying to
network.join(lobbyCode)hang indefinitely — noconnectedevent, no error, and no feedback to the app.Debugging through
chrome://webrtc-internals/, I observed:icecandidateerrorevents occur (STUN discovery failures).addIceCandidate) are generated.iceconnectionstatechangenever fires.Cause:
Impact:
Suggestion:
errorevent or afailedconnection state after a timeout.