Cloud Proxy
Feature Introduction
By setting the SDK's cloud proxy interface, all corresponding SDK traffic is relayed through a cloud proxy server to communicate with RTC and L3 (Live Streaming).
- The "Cloud Proxy" feature is a
paidfeature. If you need to use this feature, please contact ZEGO sales for consultation. - After enabling 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: Standard Cloud Proxy and Smart Cloud Proxy. Developers can choose the appropriate cloud proxy mode according to your business needs.
| Standard Cloud Proxy | Smart Cloud Proxy | |
|---|---|---|
| Description | When initializing the SDK, directly use cloud proxy mode. | When initializing the SDK, prioritize trying direct connection network mode.
When network switches, if network connectivity is detected and currently in direct connection mode, it will directly attempt according to the SDK initialization logic. |
| Use Cases | When you are in restrictive network environments such as hospitals, government, or company internal networks with intranet restrictions, hoping to use public cloud RTC or L3 services. | When your users are in scenarios with both public network and restrictive networks, and you cannot determine users' network usage conditions, hoping to prioritize using public cloud RTC or L3 services, and use cloud proxy service when public cloud RTC or L3 services are unavailable. |
Prerequisites
Before using cloud proxy, please ensure:
- You have created a project in the ZEGOCLOUD Console and applied for a valid AppID and AppSign. For details, please refer to Console - Project Information.
- You have integrated the ZEGO Express SDK in the project and implemented basic audio and video publishing and playing functions. For details, please refer to Quick Start - Integration and Quick Start - Implementation Flow.
Usage Steps
1 Enable cloud proxy service
Apply to ZEGO technical support to enable the cloud proxy service. After enabling the service, developers will obtain a cloud proxy domain and port information.
2 Configure cloud proxy
Call setCloudProxyConfig to configure cloud proxy.
This interface must be called before calling the createEngineWithProfile interface to create the engine.
- Interface prototype
/**
* Set cloud proxy.
*
* This interface needs to be called before createEngineWithProfile.
* After calling this interface, all network requests and sending of Express SDK will be relayed through cloud proxy.
*
* @param proxyList Cloud proxy information list, supports setting multiple cloud proxy information.
* @param token Authentication token. If the customer's authentication method is appsign, this can be empty. Otherwise, token must be filled.
* @param enable Whether to enable cloud proxy
*/
(void)setCloudProxyConfig:(NSArray<ZegoProxyInfo *> *)proxyList
token:(NSString *)token
enable:(BOOL)enable;- Call example
ZegoProxyInfo* proxy = [ZegoProxyInfo alloc];
// Domain and port, developers fill in according to the relevant information obtained when enabling cloud proxy service
proxy.hostName = @"xxxxxxxxxxxxx.zego.im";
proxy.port = 10826;
NSArray<ZegoProxyInfo *> *inputArray = @[proxy];
[ZegoExpressEngine setCloudProxyConfig:inputArray token:@"" enable:TRUE];FAQ
How to resolve if cloud proxy setting does not take effect?
- Ensure you have contacted ZEGO technical support to enable the cloud proxy service and obtained valid cloud proxy port and domain.
- Ensure the cloud proxy is correctly set before createEngineWithProfile. Midway modification is not supported.
Is a local proxy solution provided?
Yes, for details please refer to Local Proxy.
