logo
Live Streaming
On this page

Cloud Proxy

2024-01-30

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).

Warning
  • The "Cloud Proxy" feature is a paid feature. 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 ProxySmart Cloud Proxy
DescriptionWhen initializing the SDK, directly use cloud proxy mode.

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

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

    • If currently on cellular network, continue staying in direct connection mode for 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.

Use CasesWhen 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:

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.

Warning

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.

Previous

Supplemental Enhancement Information (SEI)

Next

Audio and Video Stream Encryption

On this page

Back to top