peerdart icon indicating copy to clipboard operation
peerdart copied to clipboard

Call connection issue when peers are outside the local network

Open Vovanella95 opened this issue 1 year ago • 12 comments

Hi developers! First of all want to say great thanks for your plugin! But I can not use it at this moment because of next issue:

Describe the bug 1Android -> Android connection can not be established in different Wifi networks. Let's say we have device A and device B. When I'm trying to connect device A to device B, I have Suspended state on device A, and Connected state on device B. Messages between devices are not working.

To Reproduce Steps to reproduce the behavior:

  1. Fix this issue #40
  2. Run Android application on 2 devices (let's say A and B)
  3. A and B are in different networks
  4. A tries to connect to B

Expected behavior A is successfully connected to B

Actual behavior Device A has Suspended status. Device B has Connected status. There are not possible to sent any messages

Smartphone (please complete the following information):

  • Android emulator
  • Samsung galaxy S20
  • Samsung galaxy Tab 7

Vovanella95 avatar Jan 03 '24 16:01 Vovanella95

Hello :wave:

Any updates on this?

Petar-CV avatar Jan 08 '24 09:01 Petar-CV

please we need this!!

hedihadi avatar Jan 16 '24 09:01 hedihadi

Me too :D

Vovanella95 avatar Jan 16 '24 10:01 Vovanella95

hello guys! Any update on this??

TetrixGauss avatar Feb 28 '24 08:02 TetrixGauss

what is going on with the developer of this package????

TetrixGauss avatar Mar 12 '24 11:03 TetrixGauss

@MuhammedKpln ??????

TetrixGauss avatar Mar 12 '24 11:03 TetrixGauss

@MuhammedKpln let it go let it go can't hold it back any more )))))

It's a joke, I'm also waiting for updates))

Vovanella95 avatar Mar 13 '24 07:03 Vovanella95

@Vovanella95 have you found any workaround for the connection with different networks? because in the same network it plays like a charm.

TetrixGauss avatar Mar 13 '24 09:03 TetrixGauss

@TetrixGauss unfortunately, no :(

Vovanella95 avatar Mar 13 '24 09:03 Vovanella95

@Vovanella95 have you checked maybe the peerjs server code ? because what i have seen is that both my clients are connected even though they are in different networks but the mediadata are not streaming

TetrixGauss avatar Mar 13 '24 09:03 TetrixGauss

To make this works, you'll need turn server(ex: Coturn)

Minimul Coturn Conf.

external-ip=<Your_Public_IP_Address>
listening-ip=0.0.0.0
listening-port=3478
min-port=49152
max-port=65535
fingerprint
lt-cred-mech
user=username:password
realm=myrealm
log-file=/var/log/coturn.log

Then create your peer connection like this below.

Peer(
    id: 'yourid-${Random().nextInt(100).toString()}', // or remove this line for auto gen. id
    options: PeerOptions(debug: LogLevel.All, config: {
      "iceServers": [
        {"urls": "stun:YOUR-SERVER-IP:3478", "username": "USERNAME-HERE", "credential": "PASSWORD-HERE"},
        {"urls": "turn:YOUR-SERVER-IP:3478", "username": "USERNAME-HERE", "credential": "PASSWORD-HERE"}
      ]
    }),
  )

KamalPixi avatar Mar 14 '24 02:03 KamalPixi

Yes! I was about to answer almost the same thing! the problem with the connection is that we need dedicated turn server and not public! Turn servers are responsible for mediaData transfers! so we need the stun server for the whole connection thing but we need the turn servers as well for the media data connection!

TetrixGauss avatar Mar 14 '24 08:03 TetrixGauss