Providing reliable NAT traversal for real-time communication.
A STUN (Session Traversal Utilities for NAT) server is a critical component for establishing peer-to-peer connections in real-time communication applications like WebRTC, VoIP, and online gaming. It helps clients behind a router or firewall discover their public IP address and port, which is information that can then be shared with other peers.
To use this STUN server, you will need to add its URL to your application's ICE (Interactive Connectivity Establishment) configuration. Below are examples for common use cases.
In your JavaScript code, configure your RTCPeerConnection with the STUN server URL:
const configuration = {
iceServers: [
{
urls: 'stun:[Your STUN Server URL or IP]:[Port]'
}
]
};
const peerConnection = new RTCPeerConnection(configuration);
If you also offer a TURN server, it is best practice to include it in the `iceServers` array to ensure connectivity even in restricted network environments.
const configuration = {
iceServers: [
{
urls: 'stun:[Your STUN Server URL or IP]:3478'
},
{
urls: 'turn:[Your TURN Server URL or IP]:[TURN Port]',
username: '[Your Username]',
credential: '[Your Password]'
}
]
};
This server is hosted for reliable and high-performance connectivity. Please note:
[Your STUN Server URL or IP]34785349