How to configure STUN on local network?

Hi, my application would use mediaSoup peer-to-peer. So I don’t have a static IP address. Which is exactly like setting up the demo to work on localhost.

How can I configure the demo to use google/twillio’s stun servers?

I’m coming from Simple Peer with a configuration like this: GitHub - feross/simple-peer: 📡 Simple WebRTC video, voice, and data channels

config: { iceServers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:global.stun.twilio.com:3478?transport=udp' }] }

I’m getting this message in the client when I try to run both on localhost: WebRTC: ICE failed, add a STUN server and see about:webrtc for more details

When I look in the about:webrtc, it shows 3 failed candidates with some local IP’s and all the remote IP’s are 0.0.0.0.

How do you configure this in development?

Thank you!

Here’s an interesting thread: https://groups.google.com/g/discuss-webrtc/c/abtjqfFH3z8

Are you using mediasoup client? If so you just need to add the info to in the client side.

recvTransport = mediasoupDevice.createRecvTransport({ iceServers: [. ] )}

However I do not think you need to use stun and turn servers for local development

Hi Rob, I’m trying the mediasoup-demo. I can connect webrtc to the hosted version, but when I run the demo servers local on my linux desktop, both my desktop and android can browse to the website but cannot connect webrtc.

Client console logs
protoo-client:WARN:WebSocketTransport WebSocket "close" event [wasClean:true, code:1000, reason:""] +0ms mediasoup-demo-app.js:45012:10
protoo-client:Peer emit "disconnected" +10m mediasoup-demo-app.js:45012:10
mediasoup-client:Transport close() +10m mediasoup-demo-app.js:45012:10
awaitqueue stop() +10m mediasoup-demo-app.js:45012:10
mediasoup-client:Firefox60 close() +10m mediasoup-demo-app.js:45012:10
mediasoup-client:Producer transportClosed() +10m mediasoup-demo-app.js:45012:10
mediasoup-client:Producer transportClosed() +1ms mediasoup-demo-app.js:45012:10
mediasoup-client:Transport close() +3ms mediasoup-demo-app.js:45012:10
awaitqueue stop() +4ms mediasoup-demo-app.js:45012:10
mediasoup-client:Firefox60 close() +4ms mediasoup-demo-app.js:45012:10
protoo-client:WebSocketTransport _runWebSocket() [currentAttempt:1] +10m mediasoup-demo-app.js:45012:10
GEThttps://192.168.254.23:3000/favicon.ico
[HTTP/1.1 404 Not Found 1ms]

Download the React DevTools for a better development experience: https://fb.me/react-devtools react-dom.development.js:25001
mediasoup-demo DOM ready +0ms common.js:120
mediasoup-demo run() [environment:development] +1ms common.js:120
mediasoup-demo:RoomClient constructor() [roomId:"os5blo3e", peerId:"1i940cdv", displayName:"Manaphy", device:firefox] +0ms common.js:120
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: RIEInput react-dom.development.js:95
Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: PeerView react-dom.development.js:95
protoo-client:WebSocketTransport constructor() [url:wss://192.168.254.23:4443/?roomId=os5blo3e&peerId=1i940cdv&consumerReplicas=undefined, options:undefined] +0ms common.js:120
protoo-client:WebSocketTransport _runWebSocket() [currentAttempt:1] +1ms common.js:120
protoo-client:Peer constructor() +0ms common.js:120
protoo-client:Peer emit "open" +44ms common.js:120
mediasoup-demo:RoomClient _joinRoom() +73ms common.js:120
mediasoup-client:Device constructor() +0ms common.js:120
mediasoup-client:Device constructor() | detected handler: Firefox60 +0ms common.js:120
mediasoup-client:Firefox60 close() +0ms common.js:120
protoo-client:Peer request() [method:getRouterRtpCapabilities, id:1637660] +2ms common.js:120
mediasoup-client:Device load() [routerRtpCapabilities:
Object { codecs: (9) […], headerExtensions: (15) […] }
] +7ms common.js:120
mediasoup-client:Firefox60 getNativeRtpCapabilities() +7ms common.js:120
WARNING! Invalid setParameters call detected! The good news? Firefox supports sendEncodings in addTransceiver now, so we ask that you switch over to using the parameters code you use for other browsers. Thank you for your patience and support. The specific error was: Cannot change the number of encodings with setParameters Firefox60.js:103
WARNING! Invalid setParameters call detected! The good news? Firefox supports sendEncodings in addTransceiver now, so we ask that you switch over to using the parameters code you use for other browsers. Thank you for your patience and support. The specific error was: Cannot change transaction id: call getParameters, modify the result, and then call setParameters Firefox60.js:103
mediasoup-client:Device load() | got native RTP capabilities:
Object { codecs: (13) […], headerExtensions: (10) […] }
 +19ms common.js:120
h264-profile-level-id generateProfileLevelIdForAnswer() | result: [profile:1, level:31] +0ms common.js:120
mediasoup-client:Device load() | got extended RTP capabilities:
Object { codecs: (3) […], headerExtensions: (8) […] }
 +3ms common.js:120
mediasoup-client:Device load() | got receiving RTP capabilities:
Object { codecs: (5) […], headerExtensions: (6) […] }
 +1ms common.js:120
mediasoup-client:Firefox60 getNativeSctpCapabilities() +22ms common.js:120
mediasoup-client:Device load() | got native SCTP capabilities:
Object { numStreams: {…} }
 +1ms common.js:120
mediasoup-client:Device load() succeeded +0ms common.js:120
mediasoup-client:Firefox60 close() +1ms common.js:120
protoo-client:Peer request() [method:createWebRtcTransport, id:4918923] +44ms common.js:120
===================================================== RoomClient.js:2299:6
Object { id: "ddec42b4-68cf-4642-90e9-f7e6454f4390", iceParameters: {…}, iceCandidates: (1) […], dtlsParameters: {…}, sctpParameters: {…} }
RoomClient.js:2300:6
===================================================== RoomClient.js:2303:7
mediasoup-client:Device createSendTransport() +120ms common.js:120
mediasoup-client:Transport constructor() [id:ddec42b4-68cf-4642-90e9-f7e6454f4390, direction:send] +0ms common.js:120
mediasoup-client:Firefox60 run() +120ms common.js:120
protoo-client:Peer request() [method:createWebRtcTransport, id:5429772] +108ms common.js:120
mediasoup-client:Device createRecvTransport() +22ms common.js:120
mediasoup-client:Transport constructor() [id:c060ba8a-7611-48b5-96a6-e03e2b5f6a29, direction:recv] +22ms common.js:120
mediasoup-client:Firefox60 run() +23ms common.js:120
protoo-client:Peer request() [method:join, id:3034996] +22ms common.js:120
mediasoup-demo:RoomClient enableMic() +202ms common.js:120
mediasoup-demo:RoomClient enableMic() | calling getUserMedia() +0ms common.js:120
mediasoup-demo:RoomClient enableWebcam() +1ms common.js:120
mediasoup-demo:RoomClient _updateWebcams() +5ms common.js:120
mediasoup-demo:RoomClient _updateWebcams() | calling enumerateDevices() +1ms common.js:120
mediasoup-demo:RoomClient proto "request" event [method:newDataConsumer, data:
Object { peerId: null, dataProducerId: "f5c10d33-f795-4334-96e3-a9745374c12a", id: "40998b05-23a0-44ec-8430-0fcfcdbc5046", sctpStreamParameters: {…}, label: "bot", protocol: "", appData: {} }
] +7ms common.js:120
mediasoup-client:Transport consumeData() +44ms common.js:120
awaitqueue push() [name:transport.consumeData()] +0ms common.js:120
awaitqueue execute() [name:transport.consumeData()] +0ms common.js:120
mediasoup-client:Firefox60 receiveDataChannel() [options:
Object { negotiated: true, id: 0, ordered: true, maxPacketLifeTime: undefined, maxRetransmits: undefined, protocol: "" }
] +43ms common.js:120
mediasoup-client:Firefox60 receiveDataChannel() | calling pc.setRemoteDescription() [offer:
Object { type: "offer", sdp: "v=0\r\no=mediasoup-client 10000 1 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-lite\r\na=fingerprint:sha-256 B9:5A:3F:83:60:E3:3D:E1:57:84:0D:E0:19:05:1E:5B:2A:45:CD:56:3F:55:E6:CA:3D:29:6C:B6:E2:BD:67:EE\r\na=msid-semantic: WMS *\r\na=group:BUNDLE datachannel\r\nm=application 7 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 127.0.0.1\r\na=setup:actpass\r\na=mid:datachannel\r\na=ice-ufrag:w5uzy6elnqdfwiweha38zn3m47y8hz5n\r\na=ice-pwd:uvo1coo3lojlykykj05e5dpc2lcajp71\r\na=candidate:udpcandidate 1 udp 1076302079 0.0.0.0 44449 typ host\r\na=end-of-candidates\r\na=ice-options:renomination\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n" }
] +3ms common.js:120
mediasoup-client:RemoteSdp updateDtlsRole() [role:server] +0ms common.js:120
protoo-client:Peer request() [method:connectWebRtcTransport, id:8829466] +54ms common.js:120
mediasoup-client:Firefox60 receiveDataChannel() | calling pc.setRemoteDescription() [answer:
Object { type: "answer", sdp: "v=0\r\no=mozilla...THIS_IS_SDPARTA-99.0 3275316525523094856 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=fingerprint:sha-256 9C:BB:18:6D:77:CB:6F:D2:59:E5:64:7B:50:9A:64:11:0D:43:34:95:D3:EB:E2:B8:E4:A0:F2:FB:8F:78:97:DF\r\na=group:BUNDLE datachannel\r\na=ice-options:trickle\r\na=msid-semantic:WMS *\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=sendrecv\r\na=ice-pwd:1cff7ff7cb4525ef059a29d5c776fea6\r\na=ice-ufrag:f577124c\r\na=mid:datachannel\r\na=setup:active\r\na=sctp-port:5000\r\na=max-message-size:1073741823\r\n" }
] +15ms common.js:120
mediasoup-demo:RoomClient _updateWebcams() [webcams:
Array [ MediaDeviceInfo ]
] +21ms common.js:120
mediasoup-demo:RoomClient enableWebcam() | calling getUserMedia() +4ms common.js:120
mediasoup-client:DataConsumer constructor() +0ms common.js:120
awaitqueue resolving task [name:transport.consumeData()] +25ms common.js:120
mediasoup-client:WARN:Firefox60 run() | pc.connectionState not supported, using pc.iceConnectionState +0ms common.js:120
mediasoup-client:Transport connection state changed to connecting +28ms common.js:120
mediasoup-client:Transport produce() [track:
MediaStreamTrack { kind: "audio", id: "{61afde71-0a29-4362-b49a-ef2f9363f48a}", label: "HD Pro Webcam C920 Analog Stereo", enabled: true, muted: false, onmute: null, onunmute: null, readyState: "live", onended: null }
] +0ms common.js:120
awaitqueue push() [name:transport.produce()] +4ms common.js:120
awaitqueue execute() [name:transport.produce()] +0ms common.js:120
mediasoup-client:Firefox60 send() [kind:audio, track.id:{61afde71-0a29-4362-b49a-ef2f9363f48a}] +12ms common.js:120
mediasoup-client:RemoteSdp updateDtlsRole() [role:server] +26ms common.js:120
protoo-client:Peer request() [method:connectWebRtcTransport, id:4057182] +27ms common.js:120
mediasoup-client:Firefox60 send() | calling pc.setLocalDescription() [offer:
Object { type: "offer", sdp: "v=0\r\no=mozilla...THIS_IS_SDPARTA-99.0 819515262914829047 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=fingerprint:sha-256 EB:A1:E6:D6:F5:C0:34:77:95:68:5F:33:81:B2:B5:FD:4C:4E:8D:E0:85:DF:94:A8:E4:BD:01:61:5F:88:1B:06\r\na=group:BUNDLE 0\r\na=ice-options:trickle\r\na=msid-semantic:WMS *\r\nm=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101\r\nc=IN IP4 0.0.0.0\r\na=sendonly\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\r\na=fmtp:101 0-15\r\na=ice-pwd:c8b191fcc138254c30e502798b4f1d97\r\na=ice-ufrag:7331f294\r\na=mid:0\r\na=msid:{71dfeec3-9d7b-480f-95a2-ebc2a4359b28} {0f370738-b2bd-450c-acc8-f3966e5c6730}\r\na=rtcp-mux\r\na=rtpmap:109 opus/48000/2\r\na=rtpmap:9 G722/8000/1\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:101 telephone-event/8000/1\r\na=setup:actpass\r\na=ssrc:958933986 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\n" }
] +14ms common.js:120
mediasoup-client:Firefox60 send() | calling pc.setRemoteDescription() [answer:
Object { type: "answer", sdp: "v=0\r\no=mediasoup-client 10000 1 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-lite\r\na=fingerprint:sha-256 B9:5A:3F:83:60:E3:3D:E1:57:84:0D:E0:19:05:1E:5B:2A:45:CD:56:3F:55:E6:CA:3D:29:6C:B6:E2:BD:67:EE\r\na=msid-semantic: WMS *\r\na=group:BUNDLE 0\r\nm=audio 7 UDP/TLS/RTP/SAVPF 109\r\nc=IN IP4 127.0.0.1\r\na=rtpmap:109 opus/48000/2\r\na=fmtp:109 stereo=1;useinbandfec=1;usedtx=1\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=setup:passive\r\na=mid:0\r\na=recvonly\r\na=ice-ufrag:khq362uxviljsqkml6n0vj3ew3ew9vpz\r\na=ice-pwd:qfg9wsgr14rxykigvcpuptp4658m7pv1\r\na=candidate:udpcandidate 1 udp 1076302079 0.0.0.0 44449 typ host\r\na=end-of-candidates\r\na=ice-options:renomination\r\na=rtcp-mux\r\na=rtcp-rsize\r\n" }
] +2ms common.js:120
protoo-client:Peer request() [method:produce, id:2092895] +13ms common.js:120
mediasoup-client:WARN:Firefox60 run() | pc.connectionState not supported, using pc.iceConnectionState +26ms common.js:120
mediasoup-client:Transport connection state changed to connecting +26ms common.js:120
mediasoup-client:Producer constructor() +0ms common.js:120
awaitqueue resolving task [name:transport.produce()] +31ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +222ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:614670] +194ms common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +8ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:597455] +10ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +4ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +7ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:1294265] +10ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +34ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +6ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +0ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +0ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +0ms common.js:120
protoo-client:Peer request() [method:getDataConsumerStats, id:4155548] +42ms common.js:120
Will-change memory consumption is too high. Budget limit is the document surface area multiplied by 3 (354006 px). Occurrences of will-change over the budget will be ignored. 192.168.254.23:3000
mediasoup-client:Transport produce() [track:
MediaStreamTrack { kind: "video", id: "{2d2c25f3-f8e7-4030-bfc4-448299bbd4cf}", label: "HD Pro Webcam C920", enabled: true, muted: false, onmute: null, onunmute: null, readyState: "live", onended: null }
] +607ms common.js:120
awaitqueue push() [name:transport.produce()] +602ms common.js:120
awaitqueue execute() [name:transport.produce()] +0ms common.js:120
mediasoup-client:Firefox60 send() [kind:video, track.id:{2d2c25f3-f8e7-4030-bfc4-448299bbd4cf}] +616ms common.js:120
WARNING! Invalid setParameters call detected! The good news? Firefox supports sendEncodings in addTransceiver now, so we ask that you switch over to using the parameters code you use for other browsers. Thank you for your patience and support. The specific error was: Cannot change the number of encodings with setParameters Firefox60.js:263
WARNING! Invalid setParameters call detected! The good news? Firefox supports sendEncodings in addTransceiver now, so we ask that you switch over to using the parameters code you use for other browsers. Thank you for your patience and support. The specific error was: Cannot change transaction id: call getParameters, modify the result, and then call setParameters Firefox60.js:263
mediasoup-client:Firefox60 send() | calling pc.setLocalDescription() [offer:
Object { type: "offer", sdp: "v=0\r\no=mozilla...THIS_IS_SDPARTA-99.0 819515262914829047 1 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=fingerprint:sha-256 EB:A1:E6:D6:F5:C0:34:77:95:68:5F:33:81:B2:B5:FD:4C:4E:8D:E0:85:DF:94:A8:E4:BD:01:61:5F:88:1B:06\r\na=group:BUNDLE 0 1\r\na=ice-options:trickle\r\na=msid-semantic:WMS *\r\nm=audio 54355 UDP/TLS/RTP/SAVPF 109 9 0 8 101\r\nc=IN IP4 47.185.148.224\r\na=candidate:0 1 UDP 2122252543 192.168.254.23 54355 typ host\r\na=candidate:2 1 UDP 2122121471 172.17.0.1 57888 typ host\r\na=candidate:4 1 UDP 2122187007 172.18.0.1 48497 typ host\r\na=candidate:6 1 TCP 2105524479 192.168.254.23 9 typ host tcptype active\r\na=candidate:7 1 TCP 2105393407 172.17.0.1 9 typ host tcptype active\r\na=candidate:8 1 TCP 2105458943 172.18.0.1 9 typ host tcptype active\r\na=candidate:1 1 UDP 1686052863 47.185.148.224 54355 typ srflx raddr 192.168.254.23 rport 54355\r\na=candidate:3 1 UDP 1685921791 47.185.148.224 57888 typ srflx raddr 172.17.0.1 rport 57888\r\na=candidate:5 1 UDP 1685987327 47.185.148.224 48497 typ srflx raddr 172.18.0.1 rport 48497\r\na=sendonly\r\na=end-of-candidates\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2/recvonly urn:ietf:params:rtp-hdrext:csrc-audio-level\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=fmtp:109 maxplaybackrate=48000;stereo=1;useinbandfec=1\r\na=fmtp:101 0-15\r\na=ice-pwd:c8b191fcc138254c30e502798b4f1d97\r\na=ice-ufrag:7331f294\r\na=mid:0\r\na=msid:{71dfeec3-9d7b-480f-95a2-ebc2a4359b28} {0f370738-b2bd-450c-acc8-f3966e5c6730}\r\na=rtcp-mux\r\na=rtpmap:109 opus/48000/2\r\na=rtpmap:9 G722/8000/1\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:101 telephone-event/8000/1\r\na=setup:actpass\r\na=ssrc:958933986 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\nm=video 0 UDP/TLS/RTP/SAVPF 120 124 121 125 126 127 97 98\r\nc=IN IP4 0.0.0.0\r\na=bundle-only\r\na=sendonly\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:5 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:6/recvonly http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:8/sendonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:9/sendonly urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1\r\na=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1\r\na=fmtp:120 max-fs=12288;max-fr=60\r\na=fmtp:124 apt=120\r\na=fmtp:121 max-fs=12288;max-fr=60\r\na=fmtp:125 apt=121\r\na=fmtp:127 apt=126\r\na=fmtp:98 apt=97\r\na=ice-pwd:c8b191fcc138254c30e502798b4f1d97\r\na=ice-ufrag:7331f294\r\na=mid:1\r\na=msid:{71dfeec3-9d7b-480f-95a2-ebc2a4359b28} {11123dd3-e3fe-4421-926d-ec06d7796d9c}\r\na=rid:r2 send\r\na=rid:r1 send\r\na=rid:r0 send\r\na=rtcp-fb:120 nack\r\na=rtcp-fb:120 nack pli\r\na=rtcp-fb:120 ccm fir\r\na=rtcp-fb:120 goog-remb\r\na=rtcp-fb:120 transport-cc\r\na=rtcp-fb:121 nack\r\na=rtcp-fb:121 nack pli\r\na=rtcp-fb:121 ccm fir\r\na=rtcp-fb:121 goog-remb\r\na=rtcp-fb:121 transport-cc\r\na=rtcp-fb:126 nack\r\na=rtcp-fb:126 nack pli\r\na=rtcp-fb:126 ccm fir\r\na=rtcp-fb:126 goog-remb\r\na=rtcp-fb:126 transport-cc\r\na=rtcp-fb:97 nack\r\na=rtcp-fb:97 nack pli\r\na=rtcp-fb:97 ccm fir\r\na=rtcp-fb:97 goog-remb\r\na=rtcp-fb:97 transport-cc\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:120 VP8/90000\r\na=rtpmap:124 rtx/90000\r\na=rtpmap:121 VP9/90000\r\na=rtpmap:125 rtx/90000\r\na=rtpmap:126 H264/90000\r\na=rtpmap:127 rtx/90000\r\na=rtpmap:97 H264/90000\r\na=rtpmap:98 rtx/90000\r\na=setup:actpass\r\na=simulcast:send r2;r1;r0\r\na=ssrc:691493340 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\na=ssrc:2225191317 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\na=ssrc:624430464 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\na=ssrc:1093352713 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\na=ssrc:2709867752 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\na=ssrc:3539339133 cname:{04904ef5-5be7-4019-a65f-ca6830f91ee9}\r\na=ssrc-group:FID 691493340 2225191317\r\na=ssrc-group:FID 624430464 1093352713\r\na=ssrc-group:FID 2709867752 3539339133\r\n" }
] +2ms common.js:120
mediasoup-client:Firefox60 send() | calling pc.setRemoteDescription() [answer:
Object { type: "answer", sdp: "v=0\r\no=mediasoup-client 10000 2 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=ice-lite\r\na=fingerprint:sha-256 B9:5A:3F:83:60:E3:3D:E1:57:84:0D:E0:19:05:1E:5B:2A:45:CD:56:3F:55:E6:CA:3D:29:6C:B6:E2:BD:67:EE\r\na=msid-semantic: WMS *\r\na=group:BUNDLE 0 1\r\nm=audio 7 UDP/TLS/RTP/SAVPF 109\r\nc=IN IP4 127.0.0.1\r\na=rtpmap:109 opus/48000/2\r\na=fmtp:109 stereo=1;useinbandfec=1;usedtx=1\r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=setup:passive\r\na=mid:0\r\na=recvonly\r\na=ice-ufrag:khq362uxviljsqkml6n0vj3ew3ew9vpz\r\na=ice-pwd:qfg9wsgr14rxykigvcpuptp4658m7pv1\r\na=candidate:udpcandidate 1 udp 1076302079 0.0.0.0 44449 typ host\r\na=end-of-candidates\r\na=ice-options:renomination\r\na=rtcp-mux\r\na=rtcp-rsize\r\nm=video 7 UDP/TLS/RTP/SAVPF 120 124\r\nc=IN IP4 127.0.0.1\r\na=rtpmap:120 VP8/90000\r\na=rtpmap:124 rtx/90000\r\na=fmtp:120 x-google-start-bitrate=1000\r\na=fmtp:124 apt=120\r\na=rtcp-fb:120 nack \r\na=rtcp-fb:120 nack pli\r\na=rtcp-fb:120 ccm fir\r\na=rtcp-fb:120 transport-cc \r\na=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:8 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:7 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:5 urn:ietf:params:rtp-hdrext:toffset\r\na=setup:passive\r\na=mid:1\r\na=recvonly\r\na=ice-ufrag:khq362uxviljsqkml6n0vj3ew3ew9vpz\r\na=ice-pwd:qfg9wsgr14rxykigvcpuptp4658m7pv1\r\na=candidate:udpcandidate 1 udp 1076302079 0.0.0.0 44449 typ host\r\na=end-of-candidates\r\na=ice-options:renomination\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rid:r2 recv\r\na=rid:r1 recv\r\na=rid:r0 recv\r\na=simulcast:recv r2;r1;r0\r\n" }
] +2ms common.js:120
protoo-client:Peer request() [method:produce, id:4674790] +360ms common.js:120
mediasoup-client:Producer constructor() +622ms common.js:120
awaitqueue resolving task [name:transport.produce()] +20ms common.js:120
mediasoup-demo:RoomClient _getWebcamType() | it seems to be a front camera +375ms common.js:120
mediasoup-demo:WARN:PeerView audioElem.play() failed:DOMException: The fetching process for the media resource was aborted by the user agent at the user's request. +0ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +2s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:8270162] +2s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +4ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +3ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:3008250] +7ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +8ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:1856945] +9ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +4ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +2ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:4256463] +5ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getDataConsumerStats, id:413203] +8ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +3s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:5573283] +3s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +12ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:1571332] +16ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +3ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +13ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:614922] +16ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +3ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +25ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:302876] +28ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +16ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +0ms common.js:120
protoo-client:Peer request() [method:getDataConsumerStats, id:979209] +22ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +3s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:6568810] +3s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +14ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:5042575] +20ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +2ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +26ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:115085] +27ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +17ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:1221] +19ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +6ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +12ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getDataConsumerStats, id:8481109] +19ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +3s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:6236149] +3s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +2ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +6ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:5360388] +7ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +7ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:9140887] +8ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +29ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +16ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:8295232] +45ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +25ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +39ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +2ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +0ms common.js:120
protoo-client:Peer request() [method:getDataConsumerStats, id:4662417] +66ms common.js:120
WebRTC: ICE failed, add a TURN server and see about:webrtc for more details
mediasoup-client:WARN:Firefox60 run() | pc.connectionState not supported, using pc.iceConnectionState +11s common.js:120
mediasoup-client:Transport connection state changed to failed +11s common.js:120
mediasoup-client:WARN:DataConsumer DataChannel "close" event +0ms common.js:120
mediasoup-demo:WARN:RoomClient DataConsumer "close" event +0ms common.js:120
WebRTC: ICE failed, add a TURN server and see about:webrtc for more details
mediasoup-client:WARN:Firefox60 run() | pc.connectionState not supported, using pc.iceConnectionState +648ms common.js:120
mediasoup-client:Transport connection state changed to failed +647ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +3s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:1140022] +3s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +6ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +7ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:3713782] +13ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +8ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +16ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:3446871] +24ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +4ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +1ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:8715052] +5ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +41ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +0ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +3s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:6954391] +3s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +12ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:1853152] +17ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +11ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:2027757] +16ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +8ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +2ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:8586339] +9ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +18ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +1ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +0ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +0ms common.js:120
mediasoup-demo:RoomClient getSendTransportRemoteStats() +3s common.js:120
protoo-client:Peer request() [method:getTransportStats, id:6111338] +3s common.js:120
mediasoup-demo:RoomClient getSendTransportLocalStats() +9ms common.js:120
mediasoup-demo:RoomClient getRecvTransportRemoteStats() +11ms common.js:120
protoo-client:Peer request() [method:getTransportStats, id:4370948] +20ms common.js:120
mediasoup-demo:RoomClient getRecvTransportLocalStats() +5ms common.js:120
mediasoup-demo:RoomClient getAudioRemoteStats() +10ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:8995218] +15ms common.js:120
mediasoup-demo:RoomClient getAudioLocalStats() +6ms common.js:120
mediasoup-demo:RoomClient getVideoRemoteStats() +5ms common.js:120
protoo-client:Peer request() [method:getProducerStats, id:2398671] +11ms common.js:120
mediasoup-demo:RoomClient getVideoLocalStats() +8ms common.js:120
mediasoup-demo:RoomClient getChatDataProducerRemoteStats() +14ms common.js:120
mediasoup-demo:RoomClient getBotDataProducerRemoteStats() +0ms common.js:120
mediasoup-demo:RoomClient getDataConsumerRemoteStats() +0ms common.js:120

I tried adding ice servers in RoomClient.js here and here, but I’m getting the same.

iceServers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:global.stun.twilio.com:3478' }],

Am I missing anything?

Thanks for your reply @Bigcat

Mediasoup server is not a STUN/TURN client. It uses an address supplied in the configuration file as its own address when establishing the connection. See webRtcServerOptions .listenInfos.announcedIp in the config.js. You need to change it to an address of some local network interface that the browser is able to connect (not 127.0.0.1 / localhost). If there is no static host address, then, for example, a dynamic one provided to your computer by the DHCP server will do.

Hi @snnz , thanks for the reply.

I got my ip from whatismyip.com, tried this command, verified it was set in config.js, but I’m still getting the same behavior:

MEDIASOUP_ANNOUNCED_IP=111.111.111.111 npm start

I was wanting to use mediaSoup in an Electron desktop app, but I don’t think it’s going to work. Do you know anyone who’s gotten that to work?

Anyways, cool project and thanks for your help!

Providing that the signalling is working properly, you should see this address as a remote candidate in about:webrtc. Try to figure out what the browser tries to pair with it and what is the result.

@Michael777 help me better understand what you did. You cloned the demo project, built the react app and run the server. How did you server the web app? Are you able to view the web app? Are you able to run the server. if you try to access the server from the browser over whatever port you used, what do you get?

Did you follow the doc here?

Hi Rob, thanks for asking. I just tried it again with my dev env: Ubuntu (Mint), zsh, nvm, and node 18.

I started with the instructions here

After I copied the config, I didn’t change it, I just made certs where it expected:

mkdir certs
cd certs 
openssl req -newkey rsa:2048 -nodes -keyout privkey.pem -x509 -out fullchain.pem 

Then I ran MEDIASOUP_ANNOUNCED_IP=111.111.111.111 npm start

In another gnome-terminal tab, I started the client app:

cd ../app
npm install --legacy-peer-deps  
npm start

It opens my default browser (Firefox latest) and I get a bunch of “connection failed: wss://192.168.254.23:4443/?roomId=ggmr40zs&peerId=st7m39in&consumerReplicas=undefined.” so I opened those with https to clear the cert error.

Then I see console messages in both browser and app scroll by as they talk through protoo.

Refresh and in Firefox I see WebRTC: ICE failed, add a STUN server and see about:webrtc for more details. If I close FF tab and open the same URL in Chrome, I don’t get those messages.

Then I try to open the invitation link in Android Chrome, it connects to the web app, but I never get video to/from the desktop.

I’ve been using this setup for Webrtc testing w/ SimplePeer, so I know it can work.

mediaSoup looked interesting because of its process model and media pipeline. Is there a simpler demo I could start with?

I’m not a WebRTC expert, but for my use case (Web App that connects Electron apps peer-to-peer), I’m pretty sure I’ll need at least one side to have a full ICE implementation.

Do you see how mediaSoup could work in Electron apps peer-to-peer?

Thank you!

Where is the server part? Do you have a server run on 192.168.254.23:4443?