Skip to content

Commit

Permalink
add page about network/fw
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbugli committed Nov 5, 2024
1 parent 7a7ed04 commit ab7c7a9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions docusaurus/video/docusaurus/docs/api/misc/networking.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
id: networking_firewall
sidebar_position: 2
slug: /misc/networking
title: 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.

### Recommended Firewall Rules
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.
2 changes: 1 addition & 1 deletion docusaurus/video/docusaurus/docs/api/misc/rate_limits.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: rate_limits
sidebar_position: 2
sidebar_position: 3
title: Rate limits
---

Expand Down

0 comments on commit ab7c7a9

Please sign in to comment.