1
votes

I am new and sorry for my English. I am working on WebRTC Video call, i follow and run Demo application that is apprtc.appspot.com its OK locally. but I am getting following error

"XMLHttpRequest cannot load https://computeengineondemand.appspot.com/turn?username=83926066&key=4080218913. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access."

after Googling i find that i have to Run my own TURN server if i have to publish my application on globally.

I follow this https://www.dialogic.com/den/developer_forums/f/71/p/10238/38432.aspx to Install TURN server i installed server by following this and server in running.

Now my problem is how to use this Server for my application? how to set or get URL of server to call form app?

thanks in advance.

1
The link you provide already has a clear answer for that: var pc_config = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}, {"url":"turn:my_username@<turn_server_ip_address>", "credential":"my_password"}]}; pc_new = new webkitRTCPeerConnection(pc_config);Robert

1 Answers

1
votes

I believe that this one should help you:

var pcConfig = {};
var pcConstraints = {};
var turnServer = {
  username:'authUserNameAsConfiguredOnServer',
  credential: 'password',
  url:'turn:YOUR_SERVER_IP_HERE:YOUR_SERVER_PORT_HERE'
}
pcConfig.iceServers = [turnServer] 
var pc = new RTCPeerConnection(pcConfig, pcConstraints);
// use your conn here