Setting and Using a Proxy with Vonage Video API SDKs Setting and Using a Proxy with Vonage Video API SDKs

Setting and Using a Proxy with Vonage Video API SDKs

Maria Scieranska

Objective

Setting a proxy URL in the Video API SDK.

Applies To

  • Vonage Video SDK
  • Proxy Server

Procedure

Note: Proxy can be used to direct all API traffic except audio/video stream data. Proxy can be set on both Opentok and Unified environments.

How-to-recognize-if-I-m-using-Vonage-Video-API-Unified-Environment-or-Vonage-Video-API-OpenTok-environment

JS SDK

Call the `OT.setProxyUrl()` method to set the proxy server URL:

OT.setProxyUrl('https://proxy-url.com');

You must call this method before calling any other Vonage methods. This ensures that the proxy server is used for Vonage traffic.

Note: This method was added as an undocumented method in 2.17.4. In previous versions, you set the proxy server URL using an undocumented option when calling the `OT.initSession()` method. However, this is option now deprecated and replaced with the `OT.setProxyUrl()` method.

Android SDK

Set the proxy server URL by calling the setProxyUrl() method of the Session.Builder object you use to instantiate a Session object:

mSession = new Session.Builder(context, API_KEY, SESSION_ID)
.setProxyUrl("https://proxy-url.com")
.build();

iOS SDK

Set the proxy server URL by setting the proxyURL property of the OTSessionSettings object you pass into the `[OTSession initWithApiKey:sessionId:delegate:settings:]` method:

OTSessionSettings *settings = [[OTSessionSettings alloc] init];
settings.proxyURL = @"https://proxy-url.com";
session = [[OTSession alloc] initWithApiKey:kApiKey
                                        sessionId:kSessionId
delegate:self
settings:settings];

Windows SDK

Set the proxy server URL by setting the proxyUrl parameter of the Session() constructor:

Session = new Session.Builder(Context.Instance, API_KEY, SESSION_ID)
{
ProxyUrl = "https://proxy-url.com"
}.Build();

Linux SDK

Set the proxy server URL by calling the otc_session_settings_set_proxy_url() function:

otc_session_settings_set_proxy_url(session_settings, "https://proxy-url.com");
otc_session *session = otc_session_new_with_settings(API_KEY,
SESSION_ID,
&session_callbacks,
session_settings);

macOS SDK

Set the proxy server URL by calling the otc_session_settings_set_proxy_url() function:

otc_session_settings_set_proxy_url(session_settings, "https://proxy-url.com");
otc_session *session = otc_session_new_with_settings(API_KEY,
SESSION_ID,
&session_callbacks,
session_settings);

React Native SDK

Set the proxyUrl property of the options prop you pass into the OTSession component:

<OTSession
apiKey="your-api-key"
sessionId="your-session-id"
token="your-session-token"
options={{
proxyUrl: 'https://proxy-url.com',
// ... other options
}}
>
<OTPublisher/>
<OTSubscriber/>
</OTSession>

 

Additional Information

For more information on the configuration of Proxy servers, please refer to our developer docs below:

Vonage Video API Unified Environment

IP Proxy

EU Proxy 

Vonage Video API Opentok Environment

IP Proxy

EU Proxy