Technology Encyclopedia Home >Which ports or domain names need to be configured as whitelists for WebRTC?

Which ports or domain names need to be configured as whitelists for WebRTC?

WebRTC (Web Real - Time Communication) is a technology that enables real - time communication in web browsers. To ensure proper functionality and security, certain ports and domain names may need to be configured as whitelists.

Ports

  • UDP Ports: WebRTC primarily uses UDP (User Datagram Protocol) for media transmission due to its low latency. Commonly used UDP port ranges are from 1024 to 65535. For example, in a video conferencing application using WebRTC, the media streams might be sent over UDP ports like 5004, 5005, etc. These ports are often used for RTP (Real - time Transport Protocol) which is responsible for carrying the audio and video data.
  • TCP Ports: Although WebRTC mainly relies on UDP, it may also use TCP (Transmission Control Protocol) for certain control signaling. Ports like 80 (HTTP) and 443 (HTTPS) are commonly used for signaling purposes. For instance, when a WebRTC client wants to establish a connection with a server to exchange session descriptions (SDP), it might use HTTP or HTTPS over ports 80 or 443 respectively.

Domain Names

  • Signaling Server Domain Names: The signaling server is used to exchange information such as session descriptions and candidate ice (Interactive Connectivity Establishment) between WebRTC peers. For example, if you have a custom signaling server with the domain name signaling.example.com, this domain name should be whitelisted. This allows the WebRTC clients to communicate with the signaling server to set up the connection.
  • STUN/TURN Server Domain Names: STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) servers are used to help WebRTC peers discover their public IP addresses and traverse NATs (Network Address Translators). If you are using a STUN server with the domain name stun.example.com or a TURN server with the domain name turn.example.com, these domain names need to be whitelisted. For example, in a corporate network with strict NAT policies, TURN servers are often used to relay media streams between peers.

If you are using cloud services for your WebRTC application, Tencent Cloud offers a range of relevant services. For example, Tencent Cloud's Global Accelerator can help optimize the network performance of your WebRTC application by providing a global network acceleration solution. It can ensure that the signaling and media streams are transmitted efficiently across different regions, reducing latency and improving the user experience. Additionally, Tencent Cloud's security products can help you protect your WebRTC application from various security threats, such as DDoS attacks and unauthorized access.