
Share:
Rafay is a Senior Software Engineer at Vonage, working on the Video Media team within the API Engineering department. He focuses on building and maintaining the mission-critical infrastructure that powers real-time video communication at scale, from session lifecycle management and signalling protocols to AI-powered integrations and developer tooling.
China Relay EOL: Build Your Own Relay With Vonage Video API
Time to read: 7 minutes
Note: This guide is intended for Vonage Video API customers who previously used China Relay, or any customer seeking to serve users in mainland China.
Background
While China Relay's end-of-life marks a transition, it also opens the door to something better: full ownership and control of your relay infrastructure. Rather than depending on a third-party managed service, you can now build a solution that is entirely yours, one that gives you direct visibility into your compliance posture and the flexibility to adapt as China's legal and regulatory requirements evolve. This guide walks you through exactly how to do that using Vonage Video API's platform features.
Vonage's China Relay feature provided a managed relay infrastructure hosted in mainland China (AWS Beijing region) to help customers serve their end users inside China's network boundaries. It consisted of three components: a Lambda@Edge geo-detection layer, a WebSocket Proxy for API signaling, and a TURN (Traversal Using Relays around NAT) server for media relay. All three were deployed within AWS China and operated under the nexmoproxy.cn domain.
China Relay reached end-of-life in Q2 2026 and has been permanently discontinued.
This article explains how Vonage Video API customers can legally build and operate an equivalent relay solution using Vonage's platform features, specifically Configurable TURN and IP Proxy, combined with your own infrastructure hosted inside China.
Why You Need a Special Setup for China
Understanding China's requirements puts you in control. Here's what you need to be aware of to build a fully compliant, high-quality experience for your users:
All internet-facing services must have a valid Internet Communication Provider (ICP) License.
Traffic to and from international cloud infrastructure is heavily filtered by the Great Firewall, causing high packet loss and latency for WebRTC media streams.
You cannot legally route Chinese user traffic through foreign servers without the appropriate licenses.
Standard WebRTC signaling (WebSocket connections to Vonage API servers) and media (TURN relay) will both be affected and must be routed through a local proxy hosted inside China. Note that the proxy acts as a local hop to improve reachability. Signaling traffic will still ultimately leave China to reach Vonage's global infrastructure, and there is no guarantee of local termination.
The good news: Vonage Video API provides the right primitives to let you own and control this infrastructure yourself, giving you full transparency, flexibility, and long-term compliance confidence.
The Replacement Architecture
Instead of relying on Vonage-managed relay servers in China, you can build your own relay tier using these components:
Component | What It Does | Who Provides It |
Configurable TURN | Points the Vonage Video SDK to your own TURN servers hosted inside China, instead of Vonage’s global TURN fleet. | Vonage add-on API feature |
IP Proxy | Routes all Vonage Video API signaling traffic, including API calls, WebSocket connections, and logging, through your proxy server inside China. | Vonage add-on API feature |
Chinese Cloud Infrastructure | Hosts your TURN server and proxy inside China, helping keep traffic within compliant boundaries. | You, using a provider such as Alibaba Cloud, Tencent Cloud, or Huawei Cloud |
ICP License | Required by Chinese law to legally operate any internet-facing service in mainland China. | You, obtained from the relevant Chinese authorities |
Note: Both Configurable TURN and IP Proxy are add-on features that must be enabled on your Vonage account. Contact your Vonage account representative to have them activated.
Step-by-Step Guide
Step 1: Obtain an ICP License
Before anything else, you must obtain the required Chinese government license(s):
ICP Filing (备案 / Beian): Required for websites and applications accessible from China. Typically obtained through your Chinese cloud provider.
ICP License (许可证): Required for value-added internet services, which includes real-time communication. This is the license Vonage was unable to obtain and maintain for China Relay.
Important: Only entities with a Chinese legal entity or a licensed local partner can obtain an ICP License. We strongly recommend engaging a local legal partner familiar with Chinese telecommunications law.
⚠ Without a valid ICP License, operating a relay or proxy in China is not legally compliant.
Step 2: Provision Your TURN Server in China
Deploy a TURN server on a Chinese cloud provider of your choice by following these steps:
Choose a cloud provider with data centers inside mainland China (e.g., Alibaba Cloud, Tencent Cloud, or Huawei Cloud).
Deploy a TURN server. The open-source coturn server is a widely used and well-supported option.
Ensure your server has a stable public IP address within China and a domain registered under your ICP license.
Configure your TURN server with appropriate credentials and security settings (TLS is strongly recommended).
Your TURN server will need the following ports open:
UDP/TCP 3478 (standard TURN)
TCP 443 (TURN over TLS, recommended for Great Firewall compatibility)
Tip: Test your TURN server reachability from multiple Chinese ISPs (China Telecom, China Unicom, and China Mobile), as performance and reachability can vary significantly between providers.
Step 3: Configure Vonage Video API With Configurable TURN
Vonage's Configurable TURN feature allows you to override the default TURN server assignment for sessions and connections, pointing the client-side SDK to your own TURN servers in China instead of Vonage's global fleet.
Note: Configurable TURN is configured in the client SDKs, not the server SDKs. The examples below cover all supported client platforms.
Pass the following configuration when initialising a session in your client-side Vonage Video SDK. Replace YOUR_TURN_SERVER_HOSTNAME, YOUR_TURN_USERNAME, and YOUR_TURN_CREDENTIAL with the values from your TURN server configuration.
JavaScript (OpenTok.js)
const session = OT.initSession(API_KEY, SESSION_ID, {
iceConfig: {
includeServers: 'custom',
transportPolicy: 'relay',
customServers: [
{
urls: ['turns:YOUR_TURN_SERVER_HOSTNAME:443?transport=tcp'],
username: 'YOUR_TURN_USERNAME',
credential: 'YOUR_TURN_CREDENTIAL'
}
]
}
}); Android SDK
List<IceServer> serverList = new IceServer(
"turns:YOUR_TURN_SERVER_HOSTNAME:443?transport=tcp", // TURN server URL
"YOUR_TURN_USERNAME", // Username
"YOUR_TURN_CREDENTIAL" // Credential
);
mSession = new Session.Builder(this, API_KEY, SESSION_ID)
.setCustomIceServers(serverList, IncludeServers.Custom)
.setIceRouting(TransportPolicy.TURN)
.build();
mSession.setSessionListener(this);
mSession.connect(token); iOS SDK
OTSessionICEConfig *myICEServerConfiguration = [[OTSessionICEConfig alloc] init];
myICEServerConfiguration.includeServers = OTSessionICEIncludeServersCustom;
myICEServerConfiguration.transportPolicy = OTSessionICETransportForceTurn;
NSError *error = nil;
[myICEServerConfiguration addICEServerWithURL:@"turns:YOUR_TURN_SERVER_HOSTNAME:443?transport=tcp"
userName:@"YOUR_TURN_USERNAME"
credential:@"YOUR_TURN_CREDENTIAL"
error:&error];
OTSessionSettings *settings = [[OTSessionSettings alloc] init];
settings.iceConfig = myICEServerConfiguration;
_session = [[OTSession alloc] initWithApiKey:kApiKey
sessionId:kSessionId
delegate:self
settings:settings]; Windows SDK
List<IceServer> iceServers = new List<IceServer>() {
new IceServer(
"turns:YOUR_TURN_SERVER_HOSTNAME:443?transport=tcp", "YOUR_TURN_USERNAME", "YOUR_TURN_CREDENTIAL"
)
};
IceConfig iceConfig = new IceConfig(
iceServers,
ICETransport.Relayed,
ICEIncludeServers.Custom
);
session = new Session.Builder(context, API_KEY, SESSION_ID){
IceConfig = iceConfig
}.Build(); Linux / macOS SDK
// Provide the ICE configuration here.
struct otc_custom_ice_config ice_config;
ice_config.num_ice_servers = 1;
ice_config.ice_url = (char **)malloc(sizeof(char *) * ice_config.num_ice_servers);
ice_config.ice_url[0] = strdup("turns:YOUR_TURN_SERVER_HOSTNAME:443?transport=tcp");
ice_config.ice_user = (char **)malloc(sizeof(char *) * ice_config.num_ice_servers);
ice_config.ice_user[0] = strdup("YOUR_TURN_USERNAME");
ice_config.ice_credential = (char **)malloc(sizeof(char *) * ice_config.num_ice_servers);
ice_config.ice_credential[0] = strdup("YOUR_TURN_CREDENTIAL");
ice_config.force_turn = OTC_TRUE;
ice_config.use_custom_turn_only = OTC_TRUE;
otc_session_settings *session_settings = otc_session_settings_new();
if (session_settings != NULL) {
otc_session_settings_set_custom_ice_config(session_settings, &ice_config);
}
otc_session *session = otc_session_new_with_settings(API_KEY,
SESSION_ID,
&session_callbacks,
session_settings);
if (session == NULL) {
printf("Could not create session successfully");
return EXIT_FAILURE;
}
otc_session_connect(session, TOKEN); React Native SDK
<OTSession
applicationId="your-application-id"
sessionId="your-session-id"
token="your-session-token"
options={{
iceConfig: {
includeServers: 'custom',
transportPolicy: 'relay',
customServers: [
{
urls: [
'turns:YOUR_TURN_SERVER_HOSTNAME:443?transport=tcp'
],
username: 'YOUR_TURN_USERNAME',
credential: 'YOUR_TURN_CREDENTIAL'
}
]
}
}}
>
<OTPublisher/>
<OTSubscriber/>
</OTSession> Refer to the Vonage Video API Configurable TURN documentation for full platform-specific details.
Step 4: Route API Signaling Traffic Via IP Proxy
By default, Vonage Video API clients connect to Vonage's global signaling infrastructure (API calls, WebSocket connections, and logging traffic), which may be blocked or heavily throttled by China's firewall.
Use IP Proxy to route all non-media signaling traffic through a server you control inside China.
Note: IP Proxy routes all traffic except media streams. Media streams are handled separately by Configurable TURN (Step 3). You need both features for a complete China-compliant setup.
Follow these steps to set up your IP Proxy:
Deploy an HTTP/WebSocket reverse proxy on your Chinese cloud infrastructure. This can run on the same host as your TURN server or on a separate host.
A lightweight reverse proxy is sufficient. See the sample proxy server implementation as a reference.
Secure your proxy so it is only accessible by authorised Vonage clients (firewall rules, token-based authentication).
Configure the Vonage Video SDK to use your proxy for all API calls and WebSocket connections using the platform-specific snippets below.
Replace YOUR_CHINA_PROXY_URL in each snippet with the URL of your deployed proxy server.
JavaScript (OpenTok.js)
Call this before any other Vonage methods.
// Must be called before any other Vonage methods
OT.setProxyUrl('YOUR_CHINA_PROXY_URL'); Android SDK
Pass the proxy URL when building your session.
mSession = new Session.Builder(context, API_KEY, SESSION_ID)
.setProxyUrl("YOUR_CHINA_PROXY_URL")
.build(); iOS SDK
Set the proxy URL on your session settings object.
OTSessionSettings *settings = [[OTSessionSettings alloc] init];
settings.proxyURL = @"YOUR_CHINA_PROXY_URL";
session = [[OTSession alloc] initWithApiKey:kApiKey
sessionId:kSessionId
delegate:self
settings:settings]; Windows SDK
Set the proxy URL in the session builder.
Session = new Session.Builder(Context.Instance, API_KEY, SESSION_ID) {
ProxyUrl = "YOUR_CHINA_PROXY_URL"
}.Build(); Linux / macOS SDK
Configure the proxy URL on the session settings.
otc_session_settings_set_proxy_url(session_settings, "YOUR_CHINA_PROXY_URL");
otc_session *session = otc_session_new_with_settings(API_KEY, SESSION_ID,
&session_callbacks, session_settings); React Native SDK
Pass the proxy URL in the session options prop.
<OTSession
apiKey="your-api-key"
sessionId="your-session-id"
token="your-session-token"
options={{
proxyUrl: 'YOUR_CHINA_PROXY_URL',
}}
>
<OTPublisher/>
<OTSubscriber/>
</OTSession> Refer to the Vonage Video API IP Proxy documentation for full configuration details.
Step 5: Test Your Setup
Before going live, validate your setup end-to-end using the following checklist:
Verify that all media is being relayed through your TURN server using WebRTC statistics (check
candidateType === "relay").
Verify that signaling traffic is flowing through your IP Proxy by monitoring proxy server logs.
Monitor TURN server logs for authentication and relay activity.
Test across different ISPs (China Telecom, China Unicom, and China Mobile), as performance can vary significantly.
Test on both mobile (iOS/Android) and desktop (web) clients.
Summary
With China Relay retired, you now have the opportunity to build a fully self-managed, compliant relay solution, one that gives you complete control over your infrastructure and keeps you ahead of China's evolving regulatory landscape. The path forward is to operate your own TURN relay and signaling proxy on Chinese cloud infrastructure, using Vonage's Configurable TURN and IP Proxy features to connect them to the Vonage Video API.
What China Relay Did | What You Do Now |
Vonage operated TURN servers in China | You deploy TURN on Alibaba Cloud, Tencent Cloud, or similar |
Vonage managed relay routing | You configure Vonage Video API with your TURN endpoint via Configurable TURN |
Vonage handled API signaling routing | You deploy an IP Proxy and configure the SDK |
Vonage held the ICP license (attempted) | You obtain your own ICP License |
Vonage managed the domain (nexmoproxy.cn) | You register and manage your own .cn domain |
Once your TURN server and IP Proxy are running, you'll have a fully compliant, self-managed relay solution for your users in mainland China.
Resources
Have a question or want to share what you're building?
Subscribe to the Developer Newsletter
Follow us on X (formerly Twitter) for updates
Watch tutorials on our YouTube channel
Connect with us on the Vonage Developer page on LinkedIn
Help us improve our developer experience by filling out our Voice of the Developer Feedback
Stay connected and keep up with the latest developer news, tips, and events.
Share:
Rafay is a Senior Software Engineer at Vonage, working on the Video Media team within the API Engineering department. He focuses on building and maintaining the mission-critical infrastructure that powers real-time video communication at scale, from session lifecycle management and signalling protocols to AI-powered integrations and developer tooling.