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.
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
Vonage Video API Opentok Environment
Articles in this section
- What is Single Peer Connection (SPC) and How do I enable it?
- How do I enable or disable Scalable Video for my video project or application?
- What are the Vonage Video API network connectivity requirements?
- OpenTok Pre-Call test, Network test, and getStats() API
- Is there any way to test my network configuration?
- Can I use Vonage Video API in a restricted network environment?
- Is it possible to deploy a TURN server inside the corporate network or DMZ?
- Does Vonage Video API provide server infrastructure?
- What are the IP ranges for Vonage Video API servers?
- What is the minimum bandwidth requirement to use the Vonage Video API?