To allow users to use the Agora RTC Unity SDK in environments with restricted network access, Agora provides a cloud proxy. Users only need to add specific IP addresses and ports to the firewall whitelist, and call the API to configure the Agora cloud proxy service.
Download the Agora RTC Unity SDK.
Integrate the SDK and prepare the development environment. For details, see QuickStart Guide.
Contact Agora technical support and provide the following information:
After receiving your application, Agora provides you with the IP addresses and ports dedicated to the cloud proxy service. Ensure your users configure their firewalls to trust these IP addresses and ports.
For SDKs v3.3.1 or later, you can call SetCloudProxy
to enable cloud proxy.
After adding the whitelist, call SetCloudProxy
, and set proxyType
as UDP_PROXY(1)
.
Test the audio and video call functionality.
To disable the cloud proxy service, call SetCloudProxy
and set proxyType
as NONE_PROXY(0)
.
For SDKs earlier than v3.2.1, you can call SetParameters
to enable cloud proxy.
After adding the whitelist, refer to the following sample code to enable cloud proxy:
// Enables the cloud proxy server and configures the service by default.
SetParameters("{\"rtc.enable_proxy\":true}");
Test the audio and video call functionality.
To disable the cloud proxy service, call SetParameters("{\"rtc.enable_proxy\":false}");
.
SetCloudProxy
before using the cloud proxy function. For example, if you need to enable cloud proxy to join a channel, call SetCloudProxy
before JoinChannel
. If you need to enable cloud proxy to conduct a lastmile test, call SetCloudProxy
before StartLastmileProbeTest
. The settings of SetCloudProxy
takes effect within the lifecycle of IRtcEngine
.