Skip to content

Unable to connect to peer outside of local network #108

@frobinsonj

Description

@frobinsonj

Hi, I am having issues connecting peers to other peers outside of their local network. I assume this is something to do with the STUN servers. I am quite new to this WebRTC stuff and I would appreciate any help in getting this working. I am not receiving the stream:added event.

Any help would be appreciated, thanks in advance.

Below is the setup (simplified)

quickconnect('<switchboard server>', {
  room: '<room>',
  expectedLocalStreams: 1,
  debug: true,
  iceServers: [{
    urls: [
    'stun:stun1.l.google.com:19302',
    'stun:stun2.l.google.com:19302',
    'stun:stun3.l.google.com:19302',
    'stun:stun4.l.google.com:19302'
    ]
  }]
})
.createDataChannel('textChat')
.addStream(stream)

This is the debug output:

rtc-quickconnect: [ckcdggkx700003b67bdts8ylc] call has been created for ckcdgihwd00003e68nljykr26 (not yet started)
rtc-quickconnect: channel textChat discovered for peer: ckcdgihwd00003e68nljykr26
rtc-quickconnect: channel not ready, current state = connecting
rtc-quickconnect: coupling ckcdggkx700003b67bdts8ylc to ckcdgihwd00003e68nljykr26
rtc/couple: [ckcdggkx700003b67bdts8ylc] ready for coupling to ckcdgihwd00003e68nljykr26
rtc/couple: [ckcdggkx700003b67bdts8ylc] ckcdgihwd00003e68nljykr26 not yet ready for offer
rtc/couple: [ckcdggkx700003b67bdts8ylc] ckcdgihwd00003e68nljykr26 is ready for coupling
rtc/couple: [ckcdggkx700003b67bdts8ylc] ckcdgihwd00003e68nljykr26 has requested a negotiation
rtc/couple: [ckcdggkx700003b67bdts8ylc] ckcdgihwd00003e68nljykr26 has requested the ability to create the offer
rtc/couple: [ckcdggkx700003b67bdts8ylc] Creating new offer for ckcdgihwd00003e68nljykr26
rtc-quickconnect: [ckcdggkx700003b67bdts8ylc] peer ckcdgihwd00003e68nljykr26 detected track
rtc/couple: [ckcdggkx700003b67bdts8ylc] signaling state have-remote-offer to ckcdgihwd00003e68nljykr26
rtc/couple: renegotiation is required, but deferring until existing connection is established
rtc/couple: [ckcdggkx700003b67bdts8ylc] signaling state stable to ckcdgihwd00003e68nljykr26
rtc/couple: [ckcdggkx700003b67bdts8ylc] coupling completed to ckcdgihwd00003e68nljykr26
rtc/couple: signalling stable and a negotiation is required, so creating one
rtc/couple: [ckcdggkx700003b67bdts8ylc] Creating new offer for ckcdgihwd00003e68nljykr26
rtc/couple: [ckcdggkx700003b67bdts8ylc] Creating new offer for connection to ckcdgihwd00003e68nljykr26
rtc-quickconnect: checking channel state, current state = connecting, connection state new
rtc/couple: reset disconnect timer, state: checking
rtc-quickconnect: checking channel state, current state = connecting, connection state checking
rtc/couple: reset disconnect timer, state: checking
rtc/couple: [ckcdggkx700003b67bdts8ylc] signaling state have-local-offer to ckcdgihwd00003e68nljykr26
rtc/couple: reset disconnect timer, state: checking
rtc/couple: [ckcdggkx700003b67bdts8ylc] signaling state stable to ckcdgihwd00003e68nljykr26
rtc/couple: [ckcdggkx700003b67bdts8ylc] coupling completed to ckcdgihwd00003e68nljykr26
rtc/couple: coupling complete, can now trigger any pending renegotiations
rtc-quickconnect: checking channel state, current state = connecting, connection state checking

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions