To allow users to use the Agora RTC Web SDK in environments with restricted network access, Agora provides the cloud proxy service.
This page describes the use of cloud proxy with the Agora RTC Web SDK v4.x.
- When using the cloud proxy service, Agora recommends using the latest version of Chrome, Firefox, and Safari.
- The cloud proxy service is not supported on mobile devices.
This section provides a high-level overview of the Agora Cloud Proxy solution and supported cloud proxy modes.
The following network diagram shows the basic working principles of the Agora Cloud Proxy.
To ensure connectivity in restricted network environments, the Agora Cloud Proxy service supports the following modes:
Mode | Description | Applicable scenario | Pricing plan | How to enable |
---|---|---|---|---|
Automatic | The SDK attempts a direct connection to Agora SD-RTN™, and automatically falls back to TCP/TLS 443 if the attempt fails.① | Used when users might be behind a firewall. | No additional charges. | The SDK uses this mode by default as of v4.9.0. |
Off | The SDK always connects to Agora SD-RTN™. | Used when users are not behind a firewall. | No additional charges. | The SDK uses this mode by default before v4.9.0. |
Force UDP | The SDK transmits data over UDP. This mode ensures a higher-quality video and audio experience. | Used when users are behind a firewall and require high-quality media. | You need to pay for this mode. | You must configure the firewall to allow specific IP addresses and ports provided by Agora. Follow the procedures in Prerequisites and Implementation to enable this cloud proxy mode. |
Force TCP | The SDK transmits data over TCP/TLS 443. | Used when users are behind a firewall and the security policy allows data to flow through TCP/TLS 443 only. | You need to pay for this mode. | You must configure the firewall to allow specific IP addresses and ports provided by Agora. Follow the procedures in Prerequisites and Implementation to enable this cloud proxy mode. |
① Automatic fallback typically occurs within 2 seconds.
Before proceeding, ensure that you meet the following requirements:
Choose the implementation based on your SDK version.
To use the Agora cloud proxy service, you must allow certain IP addresses and ports in your firewall to access the access point (AP) service, signaling service, and media service. The following provides the allowed IP list for both UDP and TCP cloud proxy. Refer to the table according to the mode of cloud proxy you want to use, and add the IP addresses and ports in the table to your firewall allowed IP list.
- In addition to port 443, DNS resolution port 53 also needs to be opened.
- Agora recommends configuring the Cloud Proxy network segment in all regions. If you want to restrict the use of Cloud Proxy in a certain region, please use it together with Geo Fencing.
Region | IP List for Media Service | IP List for Signaling and AP Service | Port |
---|---|---|---|
North America | |||
Europe | |||
India | |||
Japan | |||
Southeast Asia | |||
Mainland China |
Region | IP List for Media Service | IP List for Signaling Service and AP Service | Port |
---|---|---|---|
North America | |||
Europe | |||
India | |||
Japan | |||
Southeast Asia | |||
Mainland China |
After adding the allowed IP list, do the following to enable cloud proxy:
startProxyServer
to enable the cloud proxy service and set mode
:3
to use UDP mode.5
to use TLS mode. (Only applicable to the Web SDK v4.5.0 or later)To disable the UDP, TCP, or TLS cloud proxy, call stopProxyServer
, which enables the SDK to return the default mode.
startProxyServer
must be called before joining the channel, andstopProxyServer
must be called after leaving the channel.