Simple Peer Doesn't work on different network
Hey, I have created a simple video chat application using simple peer and webRTC and it's perfectly working on localhost and also in my domain, it's working when my devices are on the same network, but when I try from the different network it's connected but gives an error also don't show the camera stream. I also set up stun and turn server from xirsys.net but the same issue. here is the error:-
simplepeer.min.js:6 Uncaught Error: Connection failed. at p._onConnectionStateChange (simplepeer.min.js:6) at RTCPeerConnection._pc.onconnectionstatechange (simplepeer.min.js:6) _onConnectionStateChange @ simplepeer.min.js:6 _pc.onconnectionstatechange @ simplepeer.min.js:6
and here is my simple peer setup.
let peer = new SimplePeer({ initiator, stream: localStream, config: { iceServers: [{urls: [ "stun:hk-turn1.xirsys.com" ]}, {username: "my username", credential: "my credentials", urls: [ "turn:hk-turn1.xirsys.com:80?transport=tcp", "turn:hk-turn1.xirsys.com:3478?transport=tcp", "turns:hk-turn1.xirsys.com:443?transport=tcp", "turns:hk-turn1.xirsys.com:5349?transport=tcp"]}] }, trickle: false });
Please give me a solution, how can I use it from any network.