4
votes

I have a very simple webRTC 1 on 1 video chat application. It works great on localhost, but I cannot get it working across different networks. I have read as much online as I can, but nothing seems to be working. I suspect I am doing someone out of order, perhaps someone else can spot it out.

All of my signalling seems to be working (I have a lot of debug output), so I do not think that is the issue.

I have all the code up on github here, primary file of interest is videochat_manager

I thought I would sum up my process:

  • wait until there are two people in the room

  • caller creates offer description, and sends it to answerer

  • answerer either accepts, or queues up the offer until ready to answer

  • answerer is ready (has peer connection set up)

  • answerer sets remote description

  • answerer creates answer description and sends it to caller

  • caller sets remote description

  • once both peers have their descriptions set, add all ice candidates (in a queue)

  • whenever you receive your peers remote stream, add it

That is what I am doing on a very high level. Any glaring errors?

edit

You can find the demo app here. You can change rooms up in the address bar

here are four candidates on the caller side of things. There are two more that I didn't post

  • Object {type: "candidate", label: 0, id: "audio", candidate: "a=candidate:2036686134 1 udp 2122260223 10.142.85.73 35544 typ host generation 0 ↵"}

  • Object {type: "candidate", label: 1, id: "video", candidate: "a=candidate:2036686134 1 udp 2122260223 10.142.85.73 35544 typ host generation 0 ↵"}

  • Object {type: "candidate", label: 0, id: "audio", candidate: "a=candidate:937861574 1 tcp 1518280447 10.142.85.73 0 typ host generation 0 ↵"}

  • Object {type: "candidate", label: 1, id: "video", candidate: "a=candidate:937861574 1 tcp 1518280447 10.142.85.73 0 typ host generation 0 ↵"}

...

1
So, it works when on the same network but not when people are on different networks? Both are sending signals to the signalling server fine? Are you able to see IceCandidates being exchanged?Benjamin Trent
@bwtrent Yup, everything you said is corrent. I posted some sample ice candidatesToadums
None of the candidates that are being generated have public IP addresses. Something is strange with the ICE set up...Benjamin Trent
Oh...Interesting. What should I be looking for? They look at least sort of public to me haha (not 127.0.0.1 or 192.168.x.x)Toadums
try separating your ICE servers into different objects(I do not know coffeescript) but JS should be similar to this: this.pcConfig = { iceServers: [ { url: "stun:stun.l.google.com:19302" }, { url: "turn:numb.viagenie.ca", credential: "drfunk", username: "[email protected]"} ] };Benjamin Trent

1 Answers

3
votes

It would seem that your Turn and stun servers are not working the way they need to be to grab appropriate ICE candidates public IP addresses.

I tested your demo site with your current ICE servers and did not get a public IP address for any of my candidates. Try some different servers and see if that improves your situation some.