node-webrtc / node-webrtc

node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M87
Other
2.72k stars 458 forks source link

PeerConnection is closed immediately when iceServers is passed #705

Closed plukito closed 3 years ago

plukito commented 3 years ago

Environment: OS: CentOS 7 TURN server: Coturn 4.5.1.1 NodeJS: 14.16 node-webrtc: 0.4.7

I have a project, hosted on Ubuntu 20.04 server, then I zipped it along with node_modules to move the host to CentOS 7 since there is no internet available on it. The code on Ubuntu 20.04 is working normal, but not working on CentOS 7.

The problem is when I passed iceServers to new PeerConnection(), the peerConnection is closed immediately.

const pc = new RTCPeerConnection({
  iceServers: [{
    urls: "turn:some.existing.turnserver:4444",
    username: "someusernamehere",
    credential: "somecredentialhere"
  }],
  sdpSemantics: "unified-plan",
});

console.log(pc.iceConnectionState);

The result of console.log above is "closed" Also, my turn server log doesn't show that there is any connection attempt. So the nodejs is not reaching the turn server at all.


const pc = new RTCPeerConnection({
  iceServers: [],
  sdpSemantics: "unified-plan",
});

console.log(pc.iceConnectionState);

The result of console.log above is "new"

What I tried:

My question is:

Thank you.

--- UPDATE --- I already reinstall node_modules using my local CentOS WSL and upload the node_modules, but the result is still same.

plukito commented 3 years ago

Sorry for the inconvience, it seems my coturn config is not proper, though there is no warning nor error in trickle ICE.