Vortex Arcade

Checking Arcade access

Quick launch

WebRTC and TURN

View Markdown

WebRTC and TURN

TURN relays WebRTC traffic when peers cannot connect directly, for example on a restrictive network. The game's signaling service still exchanges offers, answers, and ICE candidates. Request relay credentials when a WebRTC transport needs them, while the caller's ticket is active and belongs to the same game and signed-in account. Waiting and matched tickets can qualify. Each peer requests its own credentials.

Create, refresh, and release the ticket through the matchmaking SDK. Manage the matchmaking ticket

const { iceServers, expiresAt } = await window.VortexMatchmaking.turn(ticket);
const peer = new RTCPeerConnection({ iceServers });
// Exchange SDP and ICE candidates through your game's signaling service.
  • Set iceServers before ICE gathering starts. For a relay-only test, set iceTransportPolicy: 'relay'. With the default policy, WebRTC can choose either direct or relay candidates.
  • Use expiresAt in Unix milliseconds to decide when to refresh. Arcade issues credentials for up to five minutes and can return cached credentials with less time remaining. Keep credentials in memory and out of logs, room metadata, saved data, and version control.
  • Keep the ticket active through signaling and connection setup. Release it after the game transport is ready or the handoff is cancelled. If the game needs a new relay allocation or an ICE restart later, refresh through an active ticket when available or use the game's reconnect flow.
  • The underlying endpoint is POST /api/matchmaking/turn with JSON { game, ticket }. A 401 requires Arcade sign-in, a 403 means the ticket is inactive, belongs to another game or player, or access is restricted, and a 503 can mean Arcade paused matchmaking or the relay is unavailable. Offer a direct connection only if the game supports that fallback. Otherwise show the error and let the player retry.

Keyboard shortcuts

Search gamesCtrl / ⌘ + K
Open shortcuts?
Close a panelEsc