muaz-khan / RTCMultiConnection

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
https://muazkhan.com:9001/
MIT License
2.54k stars 1.38k forks source link

RtcMultiConnection without ice servers #172

Open gaustad opened 8 years ago

gaustad commented 8 years ago

Hi Muaz, and thanks for a lot of nice software.

I'm using RtcMultiConnection-v3 to share a webcam stream to different devices and everything is working well, with your Signaling-Server over socket.io for communication.

Initially I just used default setup for the ice servers, but would like to run without ice servers as the system may be running in a closed LAN without internet access.

Tried setting iceServers to [], and this works fine for my desktop clients. But browsers on android doesn't work with this setting.

It connects and sets up ice candidate pairs but after some seconds fails with:

rmc3.js:1420 Peer connection is closed between you & ckkdr2iddobt9 Object {} state: failedRTCMultiConnection.connection.onPeerStateChanged @ rmc3.js:1420MultiPeers.onPeerStateChanged @ rmc3.js:2292onPeerStateChanged @ rmc3.js:1969PeerInitiator.peer.oniceconnectionstatechange.peer.onsignalingstatechange @ rmc3.js:3768 rmc3.js:1315 ckkdr2iddobt9 offline

The phone is on the same LAN as the server.

So my question is: What do I need to do to make RtcMultiConnection work on android without access to the internet and ice servers? Do I need to set up a local server?

Thanks in advance, Geir

dnish commented 8 years ago

What about

RTCConnection.candidates = {
     turn:     false,
     stun:    false,
     host:    true
};
xLama commented 7 years ago

@dnish It works fine.