logo
Video Call
On this page

Cloud Proxy

2024-01-30

Feature 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, L3 (Low-Latency Live Streaming).

Warning
  • The "Cloud Proxy" feature is a paid feature. 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, and port used by the cloud proxy to the enterprise firewall whitelist.

Currently, ZEGO provides two modes: General Cloud Proxy and Smart Cloud Proxy. Developers can choose the appropriate cloud proxy mode according to your business needs.

General Cloud ProxySmart Cloud Proxy
Solution DescriptionWhen initializing the SDK, directly use cloud proxy mode.

When initializing the SDK, prioritize using direct connection network mode for attempts.

  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 the current network is cellular, continue to stay in direct connection mode and retry.
    • If the current network is non-cellular, switch to cloud proxy mode.

When the network switches, if network connectivity is detected and the current mode is direct connection, attempts will be made directly according to the SDK initialization logic.

Applicable ScenariosWhen you are in restrictive network environments such as hospitals, government, or companies with internal networks, etc., 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 determine the network usage of users, you want to prioritize using public cloud RTC or L3 services, and when public cloud RTC or L3 services are unavailable, then use cloud proxy services.

Prerequisites

Before using cloud proxy, please ensure:

Usage Process

1 Open cloud proxy service

Apply to ZEGOCLOUD Technical Support to open the cloud proxy service. After opening 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 the cloud proxy.
 *
 * @param proxyList Cloud proxy information list, supports setting multiple cloud proxy information.
 * @param token Authentication token. If the authentication method used by the customer is appsign, this can be empty. Otherwise, the token must be filled in.
 * @param enable Whether to enable cloud proxy.
 */
public static void setCloudProxyConfig(ArrayList<ZegoProxyInfo> proxyList, String token,
    boolean enable)
  • Call example
ZegoProxyInfo proxy = new ZegoProxyInfo();
//Domain and port, filled in by developers based on what was obtained when opening the cloud proxy service
proxy.hostName = "xxxxxxxxxxx.zego.im";
proxy.port = 1080;
ArrayList<ZegoProxyInfo> list = new ArrayList<~>();
list.add(proxy);
ZegoExpressEngine.setCloudProxyConfig(list, "", true);

FAQ

  • Ensure that the cloud proxy service has been opened and valid proxy ports and domain have been obtained.
  • Ensure that the cloud proxy is correctly set before createEngine, and mid-way modification is not supported.

Yes, for details please refer to Local Proxy.

Previous

Traffic Control

Next

Local Proxy

On this page

Back to top