Enterprises with high-security requirements usually have firewalls that restrict employees from visiting unauthorized sites to protect internal information.
To ensure that enterprise users can connect to Agora's services through a firewall, Agora provides the cloud proxy service.
The following figure shows the working principles of the Agora cloud proxy service.
The Web SDK v4.3.0 optimizes the Agora cloud proxy architecture and enhances its connectivity in environments with restricted network access. The optimized Agora cloud proxy service also supports regional connection. If you use the Web SDK v4.3.0 or later, follow these steps to set up a cloud proxy service:
Contact support@agora.io and provide the following information:
Before joining a channel, call the startProxyServer
method to enable the cloud proxy service and set mode
as 3
, and then test if the audio call and video call or the live streaming works.
const client = AgoraRTC.createClient({mode: 'live',codec: 'vp8'});
// Enable the cloud proxy.
client.startProxyServer(3);
// Join a channel.
client.join("<YOUR TOKEN>", "<YOUR CHANNEL>").then(() => {
/** ... **/
});
To disable the cloud proxy, call the stopProxyServer
method after leaving the channel.
// After enabling the cloud proxy and joining the channel.
/** ... **/
// Leave the channel.
client.leave();
// Disable the cloud proxy.
client.stopProxyServer();
// Join the channel.
client.join("<YOUR TOKEN>", "<YOUR CHANNEL>").then(() => {
/** ... **/
});
If you use any version between the Web SDK v4.0.0 to v4.2.1, follow these steps to set up a cloud proxy service:
Contact support@agora.io and provide the following information:
Add the following test IP addresses and ports to your whitelist.
The sources are the clients that integrate the Web SDK.
Protocol | Destination | Port | Port Purpose |
---|---|---|---|
TCP | 23.236.115.138 | 443, 4000 3433 - 3460 |
Message data transmission Media data exchange |
TCP | 148.153.66.218 | 443, 4000 3433 - 3460 |
Message data transmission Media data exchange |
TCP | 47.74.211.17 | 443 | Edge node communication |
TCP | 52.80.192.229 | 443 | Edge node communication |
TCP | 52.52.84.170 | 443 | Edge node communication |
TCP | 47.96.234.219 | 443 | Edge node communication |
UDP | 23.236.115.138 | 3478 - 3500 | Media data exchange |
UDP | 148.153.66.218 | 3478 - 3500 | Media data exchange |
Before joining a channel, call the startProxyServer
method to enable the cloud proxy service and set mode
as 3
, and then test if the audio call and video call or the live streaming works.
const client = AgoraRTC.createClient({mode: 'live',codec: 'vp8'});
// Enable the cloud proxy service.
client.startProxyServer();
// Join a channel.
client.join("<YOUR TOKEN>", "<YOUR CHANNEL>").then(() => {
/** ... **/
});
Agora provides the IP addresses and ports for you to use the cloud proxy service in a production environment. Add the IP address and ports to your whitelist.
To disable the cloud proxy, call the stopProxyServer
method after leaving the channel.
// Enable the cloud proxy service and join a channel.
/** ... **/
// Leave the channel.
client.leave();
// Disable the cloud proxy service.
client.stopProxyServer();
// Rejoin a channel.
client.join("<YOUR TOKEN>", "<YOUR CHANNEL>").then(() => {
/** ... **/
});
startProxyServer
must be called before joining the channel, and stopProxyServer
must be called after leaving the channel.