Networking and Firewall

Stream Video leverages a combination of UDP and TCP protocols to deliver real-time video streams. By default, Stream uses UDP, which is the preferred protocol for real-time video transmission via WebRTC. However, some users may encounter restrictions on UDP due to firewall rules or networking configurations. If UDP is unavailable, the system automatically falls back to TCP. Although TCP provides a viable alternative, it is less ideal for real-time video, as it may result in decreased video quality.

For optimal performance, we recommend configuring firewalls to allow UDP and NAT as explained below.

Network and Port Requirements

Stream Video operates on an edge infrastructure, with a dynamically managed list of servers for video call routing. Currently, it is not possible to retrieve a comprehensive list of Stream Video hostnames due to the evolving nature of this infrastructure.

Port Ranges Used by Stream Video

Signaling (HTTP and WebSocket over TLS):

  • TCP 443 (Required for initial signaling)

WebRTC - TURN (Traversal Using Relays around NAT):

  • TCP or UDP 3478
  • TCP or UDP 32768 - 46883

WebRTC - STUN (Session Traversal Utilities for NAT):

  • UDP 46884 - 60999

Firewall and NAT Considerations

Real-time video experiences the best quality when using STUN over UDP. This setup requires allowing the designated UDP port range and configuring NAT (Network Address Translation) to work correctly on the user’s network. If a client cannot connect via STUN/UDP, the SDK automatically switches to TURN, using either UDP or TCP as needed. This allows clients to connect directly to the server via TCP if UDP is blocked or unavailable. TURN is also available over TCP for clients that are restricted from using UDP.

To ensure compatibility and quality, configure the following rules:

  • Allow TCP 443 on 0.0.0.0/0 for initial signaling.
  • Enable NAT for optimal quality (recommended but not required).
  • Allow the full range of TURN and STUN ports (TCP and UDP) for best video quality and compatibility.

This configuration ensures robust connectivity for all clients, maintaining the highest possible video quality across varying network environments.

© Getstream.io, Inc. All Rights Reserved.