logo
Video Call
On this page

Cloud Proxy

2024-01-30

Overview

By setting the SDK's cloud proxy interface, all traffic corresponding to the SDK is forwarded through the cloud proxy server to achieve communication with RTC and L3 (Live Streaming).

Caution
  • The "Cloud Proxy" feature is a paid feature. If you need to use this feature, please contact ZEGO business personnel for consultation.
  • After activating 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 ProxySmart Cloud Proxy
Solution DescriptionWhen initializing the SDK, use the cloud proxy mode directly.

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

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

    • If the current is a cellular network, continue to stay in direct connection mode and retry.
    • If the current is a non-cellular network, switch to cloud proxy mode.

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

Applicable ScenariosWhen you are in restrictive network environments such as hospitals, government, or company intranets, 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 user's network usage, and want to prioritize using public cloud RTC or L3 services, and use cloud proxy services when public cloud RTC or L3 services are unavailable.

Prerequisites

Before using cloud proxy, please ensure:

Usage Process

1 Activate cloud proxy service

Apply to ZEGOCLOUD Technical Support to activate the cloud proxy service. After activating the service, developers will obtain a cloud proxy domain name and port information.

2 Configure cloud proxy

Call setCloudProxyConfig to configure cloud proxy.

Caution

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 List of cloud proxy information, supports setting multiple cloud proxy information.
 * @param token Authentication token. If the customer uses appsign authentication, this can be empty. Otherwise, token must be filled in.
 * @param enable Whether to enable cloud proxy.
 */
static Future<void> setCloudProxyConfig(
      List<ZegoProxyInfo> proxyList, String token, bool enable)
  • Call example
var proxy = ZegoProxyInfo();
//Domain name and port, filled in by the developer according to the information obtained when activating the cloud proxy service
proxy.hostName = "xxxxxxxxxxx.zego.im";
proxy.port = 1080;
List<ZegoProxyInfo> list = [];
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 activated and a valid proxy port and domain name have been obtained.
  • Ensure that cloud proxy is set correctly before createEngine, and mid-way modification is not supported.

2. Is there a local proxy solution?

Yes, for details please refer to Local Proxy.

Previous

Media Supplemental Enhancement Information (SEI)

Next

Geofencing

On this page

Back to top