Sorry about my English. I have a problem with webRTC. My application works correctly in the same network but in different is wrong.
Technologies that I use:
In this github I push my code: github/oihi08/webrtc
I dont know why the application not runs with different networks. I have uploaded to a server, I tried it and nothing. But in the same network yes.
Thank you so much!!
It sounds like you aren't using a STUN/TURN server. There are a few steps to create a connection between two devices. One of these steps is to select one or more STUN/TURN servers (like "stun:stun.l.google.com:19302" for example). This server will be used to create a connection between peers, even when there is a firewall in the way on one or both ends.
When you set up one or more STUN/TURN servers, you will see that ice candidates will start being generated. The callback function peerConnection.onicecandidate
will be called for every ice candidate that is generated. When the library is done generating ice candidates, it calls the callback one more time with NULL
as parameter, this flags the end of the list of candidates.
You need to get these ice candidates across to the other peer somehow, usually through the same signaling server you use to create the connection in the first place. When they arrive at the other side you need to call peerconnection.addIceCandidate.
If you do these steps, you will be able to get a proper connection, even across networks with strict NAT types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With