feross / feross/simple-peer

Simple Peer Doesn't work on different network

Open
#860 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.8k
Forks
983
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.