murat-dogan / node-datachannel

WebRTC For Node.js and Electron. libdatachannel node bindings.
Mozilla Public License 2.0
308 stars 60 forks source link

Does not work with other ice servers #285

Closed 0wwafa closed 2 months ago

0wwafa commented 2 months ago

this won't work (but works in the browser) { iceServers: ['stun:142.250.82.249:3478'] } << that's a google turn server. Also: no idea how to pass credentials.

Aviv1000 commented 2 months ago

its need to be like this:

iceServers: [
  {
    urls: ["stun:142.250.82.249:3478"]
  },
  { //if its turn server you need put also credentials:
    urls: ["turn:142.250.82.249:3478"],
    username: "test",
    credential: "test"
  }
]
murat-dogan commented 2 months ago

Hello, This format will work for bindings but will not work for polyfills. https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#iceservers

It should be like @Aviv1000 mentioned.

paullouisageneau commented 2 months ago

FYI, for bindings, username and passwords must be specified in the URI with the format turn:username:password@hostname:port.

murat-dogan commented 2 months ago

I am closing the issue. If you have further questions, please feel free to re-open it.