Set proxy server

11-set_proxy_server

Set proxy server

  1. Get a TRTCCloud instance via getTRTCCloudInstance. Note: v3.1.3+ support.
import { TUICallEngine } from 'tuicall-engine-webrtc';
const options = {
  SDKAppID: 0,
  tim: tim,
};
const tuiCallEngine = TUICallEngine.createInstance(options);
const trtcCloud = tuiCallEngine.getTRTCCloudInstance();
  1. Proxy server setup is accomplished by calling callExperimentalAPI through the TRTCCloud instance ( Note: this needs to be called before the call ). The details are as follows:
trtcCloud.callExperimentalAPI(JSON.stringify({
   api: 'setNetworkProxy',
   params: {
      websocketProxy: 'wss://proxy.example.com/ws/',
      turnServer: [{
         url: '14.3.3.3:3478',
         username: 'turn',
         credential: 'turn',
      }],
      iceTransportPolicy: 'relay',
   },
}));