Setting and Using a Proxy with Vonage Video API SDKs
Objective
Setting a proxy URL in the Video API SDK.
Applies To
- Vonage Video SDK
- Proxy Server
Procedure
Note: An IP proxy can be used to direct all API traffic except audio/video stream data.
OpenTok.js (JS SDK)
Call the `OT.setProxyUrl()` method to set the proxy server URL:
OT.setProxyUrl('https://123.123.123.123:8080');
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.
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)
.setProxyUrl("https://your-proxy-url.com")
.build();
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 = @"https://your-proxy-url.com";
session = [[OTSession alloc] initWithApiKey:kApiKey
sessionId:kSessionId
delegate:self
settings:settings];
OpenTok Windows SDK
Set the proxy server URL by setting the proxyUrl parameter of the Session() constructor:
session = new Session(context: Context.Instance, apiKey: API_KEY,
sessionId: SESSION_ID, proxyUrl: "https://your-proxy-url.com");
Comments
0 comments
Please sign in to leave a comment.