logo
On this page

Cloud Proxy

2024-01-30

Function Overview

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 and L3.

Warning
  • The "Cloud Proxy" feature is a paid feature. If you need to use this feature, please contact ZEGO business personnel for consultation.
  • After enabling the cloud proxy service, if the enterprise has configured a firewall, you also need to add the cloud proxy IP to the enterprise firewall whitelist.
  • This feature does not support running in WebGL environment.

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 ProxySmart Cloud Proxy
Solution DescriptionWhen initializing the SDK, use cloud proxy mode directly.

When initializing the SDK, prioritize trying direct connection network mode.

  1. If there is network connectivity within 1 second, continue using direct connection mode.
  2. If there is no network connectivity within 1 second:

    • If currently on cellular network, continue staying in direct connection mode and retry.
    • If currently on non-cellular network, switch to cloud proxy 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.

Applicable ScenariosWhen you are in restricted network environments such as hospitals, government, company internals, etc., and want to use public cloud RTC or L3 services.When your users are in scenarios with both public network and restricted networks, and you cannot determine the user's network usage situation, and want 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:

Usage Flow

1 Enable Cloud Proxy Service

Apply to ZEGOCLOUD 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.

Warning

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 Express SDK will be forwarded through cloud proxy.
 *
 * @param proxyList Cloud proxy information list, supports setting multiple cloud proxy information.
 * @param token Authentication token. If the customer uses appsign authentication method, this can be empty. Otherwise, token must be filled in.
 * @param enable Whether to enable cloud proxy.
 */
public static void SetCloudProxyConfig(List<ZegoProxyInfo> proxyList, string token, bool enable);
  • Call example
ZegoProxyInfo proxy = new ZegoProxyInfo();
//Domain and port, filled in by the developer according to what was obtained when enabling the cloud proxy service
proxy.hostName = "xxxxxxxxxxx.zego.im";
proxy.port = 1080;
List<ZegoProxyInfo> list = new List<ZegoProxyInfo>();
list.Add(proxy);
ZegoExpressEngine.SetCloudProxyConfig(list, "", true);

FAQ

  1. How to solve if cloud proxy setting does not take effect
  • Ensure that the cloud proxy service has been enabled and valid proxy port and domain have been obtained.
  • Ensure that cloud proxy is correctly set before CreateEngine, and modification during the process is not supported.
  1. Is a local proxy solution provided?

Yes, for details please refer to Local Proxy.

Previous

Supplemental Enhancement Information (SEI)

Next

Game Voice

On this page

Back to top