This document is about: FUSION 2

STUN Servers

What is a STUN Server?

A STUN (Session Traversal Utilities for NAT) is a network protocol used to assist devices behind NAT (Network Address Translation) or a firewall in communicating with other devices on the internet. STUN servers are primarily utilized in VoIP (Voice over Internet Protocol), video conferencing, and other real-time communication applications.

Key Functions of a STUN Server

  1. Public IP Discovery: STUN servers assist devices in discovering their public IP address assigned by the NAT device.
  2. NAT Type Detection: They help in determining the type of NAT behind which the device is located (e.g., full cone, restricted cone, port-restricted cone, symmetric NAT).
  3. Relay Candidate Discovery: They provide the information necessary for devices to establish peer-to-peer connections by determining the NAT traversal strategy.

Usage of STUN Servers on Photon SDKs

Photon Fusion relies on 3rd Party STUN Servers to enable direct connections between client and server/host peers, playing a crucial role in facilitating communication and establishing seamless connections for Photon Fusion.

By default, Photon Fusion uses the publicly available Google STUN Servers, but this list can be extended in case these are not available.

Below is shown how to pass a custom STUN Server to Fusion:


// When starting the NetworkRunner
runner.StartGame(new StartGameArgs {
  // ...
  // Pass a custom STUN Server
  CustomSTUNServer = ""

List of Public 3rd Party STUN Servers

The STUN servers listed below can be used to extend the default list of servers utilized by Photon Fusion.

Back to top