Closed ptesavol closed 4 years ago
I'm not aware of someone working on a node.js wrapper yet.
There is still node-webrtc
providing full WebRTC bindings, but I guess the idea with libdatachannel is to require a lighter dependency instead, right?
Actually this is in my mind as an idea, not started yet. I used node-webrtc before.
I would be very cool to have more alternatives to node-webrtc. Not that there is anything wrong with node-webrtc, but having more alternatives would make it easier to find out whether a bug is in your own code or in the WebRTC lib you are using.
I wonder would it be possible to use https://github.com/paullouisageneau/datachannel-wasm as a basis for Nodejs native lib? Could it even possible to use some emscripten magic to directly build a version of datachannel-wasm for Nodejs?
Actually what you want here is the reverse wrapper compared to datachannel-wasm, so I don't think anything is reusable.
datachannel-wasm is a wrapper exposing a libdatachannel-compatible C++ interface for the JS webRTC API present in browsers. What would be needed for nodejs is a JS interface for the C API of libdatachannel.
Hi,
Please check my initial version of nodejs wrapper. https://github.com/murat-dogan/node-datachannel
Please check it & tell me what you think.
For now it is building libdatachannel with default options (libjuice etc...) but I will add others as options.
Great, it looks very promising :+1:
Is there a reason why callbacks are passed in constructor rather than registered on the object with something like on(event, callback)
?
Actually there is no special thing. I thought it would be more practical but to separate them could be cleaner.
Separated callbacks looks cleaner. Thanks.
This is excellent news @murat-dogan ! I'll try it out.
@murat-dogan I've linked your wrapper from libdatachannel's readme!
Thanks!
Do you know if there is a Nodejs (native) wrapper available for libdatachannel, or if somebody is working on it already?