0

I have deployed my own apprtc server with collider & turn server configured in Google App engine locally with virtualbox. Everything is working properly but I want to use this apprtc server in my another project that is in anoter IP. So, Apprtc IP and my project IP is different. Now, when I included apprtc.debug.js & appwindow.js files to my project it cannot initialize loadingParams and says this error message "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://<IP OF APPRTC>:8080/params. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)".

However, entering http://<IP OF APPRTC>:8080/params in the browser gives me correct response but not in the project called in appwindow.js .After a bit of googling I added below lines in sendUrlRequest function :

xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.setRequestHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');

Now it says "CORS request did not succeed". How can I make it work? Do I have to enable cors in server side also, if so where and how to do that? Please help me, I'm totally lost here...

  • It's not clear from the description if you are running if you are running TURN server locally or in Google App Engine. Could you clarify that? – A.Queue Jun 13 '18 at 13:57
  • Also for cors please review this section about headers in [app.yaml](https://cloud.google.com/appengine/docs/standard/go/config/appref#handlers_http_headers) – A.Queue Jun 13 '18 at 14:59

0 Answers0