close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

IP Proxy

With the IP proxy feature, OpenTok clients route all internet traffic (except for media streams) via your proxy server.

Non-media traffic includes communication to the Video API servers and logging infrastructure.

The IP proxy feature is available as an add-on feature.

There is also a configurable TURN server add-on feature that lets you route media streams via your own custom TURN servers.

Configuring the IP proxy server

You set the URL or your proxy server when you initiate an OpenTok session in the OpenTok client SDKs.

OpenTok concatenates the destination URL for all internet traffic (except media streams) to the proxy URL you provide. This traffic includes Video API calls, WebSocket connections, and log traffic made by OpenTok.js.

For example, the OpenTok client SDK logs data periodically to If you set the proxy URL to "", the client will post this data to

You should secure the proxy server so that it will be used by OpenTok clients only and not by unauthorized clients. For example, you can put the proxy server within a firewall or authenticate requests in some other way.

Here is sample code that sets up a basic proxy server for this feature:

Note: If clients will connect to OpenTok sessions in a geographical region other than that of your proxy server and you are not using the configurable TURN server feature, be sure to set the location hint when you create OpenTok sessions.

In OpenTok.js

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


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

Note: This method was added as an undocumented method in OpenTok 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.

In the OpenTok 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)

In the OpenTok 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 = @"";

session = [[OTSession alloc] initWithApiKey:kApiKey

In the OpenTok 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 = ""

In the OpenTok Linux SDK

Set the proxy server URL by calling the otc_session_settings_set_proxy_url function:

otc_session_settings_set_proxy_url(settings, "");
otc_session *session = otc_session_new_with_settings(API_KEY,

The first parameter is the otc_session_settings instance you will pass into the otc_session_new_with_settings () function to initialize an otc_session instance. The second parameter is the proxy server URL.

For more information on the otc_session_settings struct the otc_session_new_with_settings() function and connecting to the session, see Instantiating an otc_session instance and session-related callbacks.