Cloud Proxy
Introduction
By setting the SDK's cloud proxy interface, all traffic corresponding to the SDK is forwarded through the cloud proxy server to communicate with RTC, L3 (Ultra-Low Latency Live Streaming).
- The "Cloud Proxy" feature is a
paidfeature. If you need to use this feature, please contact ZEGO business personnel for consultation. - After opening the cloud proxy service, if the enterprise has configured a firewall, you also need to add the IP, domain name, and port used by the cloud proxy to the enterprise firewall whitelist.

Currently, ZEGO provides two modes: Normal Cloud Proxy and Smart Cloud Proxy. Developers can choose the appropriate cloud proxy mode according to your business needs.
| Normal Cloud Proxy | Smart Cloud Proxy | |
|---|---|---|
| Solution Description | When initializing the SDK, use the cloud proxy mode directly. | When initializing the SDK, prioritize using the direct connection network mode for attempting.
When the network switches, if network connectivity is detected and the current mode is direct connection, it will attempt directly according to the SDK initialization logic. |
| Applicable Scenarios | When you are in restrictive network environments such as hospitals, governments, and companies with internal networks, and want to use public cloud RTC or L3 services. | When your users are in scenarios with both public networks and restrictive networks, and you cannot judge the user's network usage, and want to prioritize using public cloud RTC or L3 services, and then use cloud proxy services when public cloud RTC or L3 services are unavailable. |
Prerequisites
Before using the cloud proxy, ensure that:
- A project has been created in the ZEGOCLOUD Console, and valid AppID and AppSign have been obtained. For details, please refer to Console - Project Information.
- ZEGO Express SDK has been integrated into the project, and basic audio and video streaming functionality has been implemented. For details, please refer to Quick Start - Integration and Quick Start - Implementation Process.
Usage Process
1 Open the cloud proxy service
Apply to ZEGO Technical Support to open the cloud proxy service. After opening the service, developers will obtain a cloud proxy domain name and port information.
2 Configure cloud proxy
Call setCloudProxyConfig to configure the cloud proxy.
This interface must be called before calling the createEngine interface to create the engine.
- Interface prototype
/**
* Set cloud proxy.
*
* This interface needs to be called before createEngine.
* After calling this interface, all network requests and sending of the sdk will be forwarded through the cloud proxy.
*
* @param proxyList Cloud proxy information list, supports setting multiple cloud proxy information.
* @param token Authentication token. If the customer uses appsign for authentication, this can be empty. Otherwise, the token must be filled in.
* @param enable Whether to enable cloud proxy.
*/
static void setCloudProxyConfig(const std::vector<ZegoProxyInfo> &proxyList,
const std::string &token, bool enable)- Call example
ZegoProxyInfo proxy;
// Domain name and port, filled in by developers according to what was obtained when opening the cloud proxy service
proxy.hostName = "xxxxxxxxxxx.zego.im";
proxy.port = 1080;
std::vector<ZegoProxyInfo> infos;
infos.push_back(proxy);
ZegoExpressSDK::setCloudProxyConfig(infos, "", true);FAQ
- Ensure that the cloud proxy service has been opened and valid proxy port and domain name have been obtained.
- Ensure that the cloud proxy is set correctly before createEngine, and mid-way modification is not supported.
Yes, for details please refer to Local Proxy.
