WebRTC dataChannel.readyState stalling on "connecting"

2k Views Asked by At

I'm trying to understand how to use WebRTC dataChannels, but having some issues just testing them.

I cloned https://github.com/JustGoscha/simple-datachannel but it doesn't seem to function. The offer is made, processed and responded to, but the dataChannel.readyState seems to stick to 'connecting'.

I was able to get Video/Audio working just fine over LAN with this: https://github.com/shanet/WebRTC-Example So I know my issue isn't NAT related (there are no TURN servers in that example).

Just to confirm, I edited the first example changing line 94 of dc.html and index.html to an empty array for "iceServers" to avoid any connection issues over LAN.

I'm trying to find working implementations of a dataChannel without multiple frameworks or abstractions stacked on top ( I want to learn how to use them and how they work ), but I can't seem to wrap my head around the issues I'm having.

1

There are 1 best solutions below

0
On

That particular example has not been updated for more than two years and uses the nonstandard rtp data channels which have recently been forcefully deprecated by Chrome.

https://webrtc.github.io/samples/ has multiple example of datachannels without using a framework. The samples only use the adapter.js polyfill in order to allow writing code that complies to the standard (which is still in a state of flux).