node.jswebrtcstunturnsimplewebrtc

WebRTC - Networking issue on Codelab STUN/TURN servers


this is my first question here in stackoverflow, I am very blocked and I need some help here. First of all, thank you very much.

I am trying to develop a WebRTC solution in a web app to stream video from different machines. I am developing it using NodeJS, just following the guidelines from the WebRTC codelab . Once I copied it and understood it, I developed a deploy file to deploy the solution to an Azure web app. Now I am able to see my video stream, and if I connect from a different host but in my same network I can see both video stream, each one from the different machines. Ok, this is what I want. But once I go to my web from a different network, it does not work. I can see in the console the connection from the other peer and the messages from it (maybe because the STUN server?) but the video streaming does not appear.

I think that it is because the TURN server, but I am not sure because I am trying to use others and it still does not work.

It is the same code as the codelab that I am pointing above, someone had the same issue here? Is it possible that the TURN server is not working?

(Part of the code in where the Turn server is added)

    if (location.hostname != 'localhost') {
  requestTurn(
    'https://computeengineondemand.appspot.com/turn?username=41784574&key=4080218913\''
  );
}

Thank you!


Solution

  • Well, TURN servers which relay a lot of data cost money to run. A lot of money. Nobody is going to let you access theirs for free, you need to run your own. See this blog post for more details.

    Also the URL from the codelab leads to a 404 page.