openwebrtc-examples icon indicating copy to clipboard operation
openwebrtc-examples copied to clipboard

Node.js support

Open RangerMauve opened this issue 10 years ago • 17 comments

It'd be nice if this was available as a Node.js library. It would probably also be fine if the video/audio wasn't supported directly and there was only support for the RTCDataCHannel and RTCPeerConnection

RangerMauve avatar Mar 02 '15 14:03 RangerMauve

Actually it may be quite simple to get OpenWebRTC running in a Node server. We have a daemon running on Linux (and OS X as well) that can communicate over localhost to the Node server similarly to how our browser extension do, see:

https://github.com/EricssonResearch/openwebrtc-browser-extensions http://www.openwebrtc.io/blog/2014/10/31/webrtc-in-safari-using-openwebrtc

I'm not sure exactly how to do this in Node, but all you would need to do after starting the daemon is to inject this script http://localhost:10717/owr.js in to Node's JavaScript runtime. That should add WebRTC capabilities to it.

stefanalund avatar Mar 02 '15 14:03 stefanalund

There is also https://github.com/cfsghost/node-gcontext if it's interesting.

superdump avatar Mar 02 '15 17:03 superdump

Yeah, I was thinking that it'd be more like Node.js being just another environment that has bindings to OpenWebRTC. @superdump's link seems like the direction I was thinking.

Sadly my C/C++ skills are kinda rusty these days so I'll probably either wait for someone else to do it, or brush up when I have time.

Also, out of curiosity, where is the source code for that owr.js file?

RangerMauve avatar Mar 02 '15 18:03 RangerMauve

It is in the OpenWebRTC repo: https://github.com/EricssonResearch/openwebrtc/blob/master/bridge/client/webrtc.js

stefanalund avatar Mar 02 '15 18:03 stefanalund

Thanks!

RangerMauve avatar Mar 02 '15 18:03 RangerMauve

@RangerMauve more specifically it's a concatenation of a few files. See here: https://github.com/EricssonResearch/openwebrtc/blob/master/bridge/worker/bridgeserver.js#L225 wbjsonrpc.js is in bridge/shared/ and the others are in bridge/client/.

superdump avatar Mar 02 '15 18:03 superdump

Any news about this? I'm working on a Node.js distributed system for my research, and I have seen a lot of webrtc library but not any suitable support for Node.js. I found some modules that basically download the chromium project and binds the module to the webrtc layer using node-gyp, it is a huge overhead and not really practical if we need to distributed our system. Its possible to create a simple webrtc client module for node.js using OpenWebrtc? It will be fine if we can have prebuild binaries of the library for OS X, Linux and Windows, and not a 400MB Chromium browser just for using datachannel etc.

Thanks so much for your attention, any help is really appreciated.

vsantosu avatar Jun 26 '15 18:06 vsantosu

For Node it seems that if you just want data channels, then the wrtc module is the standard right now. Doesn't seem to be supporting Windows any time soon, though.

RangerMauve avatar Jun 26 '15 18:06 RangerMauve

@RangerMauve , thats one of the modules that downloads the Chromium source and compiles everything, it ends in a huge 400MB binary just to use the DataChannel, I don't think that is practical. I think that we would end downloading the web core standard library and creating a full binding for ourselves, that would be the ideal case :(

vsantosu avatar Jun 26 '15 18:06 vsantosu

Oh, really? I didn't know that it was embedding all of chromium in it! That's pretty suboptimal, then.

RangerMauve avatar Jun 26 '15 19:06 RangerMauve

No news from us. We don't have any plans ourselves to implement the Node.js GObject Introspection support. We would welcome it though.

superdump avatar Jun 29 '15 09:06 superdump

How to run Openwebrtc Deamon in Linux?

SrujithPoondla avatar Jan 28 '16 00:01 SrujithPoondla

@SrujithPoondla https://github.com/EricssonResearch/openwebrtc/wiki/Running-and-Testing#step-2---running-the-daemon

stefanalund avatar Jan 28 '16 07:01 stefanalund

I am getting like this

srujith@PC:~/cerbero/sources/linux_x86_64/openwebrtc-0.3.0/bridge$ ./openwebrtc-daemon

** (gst-plugin-scanner:29399): CRITICAL **: Couldn't g_module_open libpython. Reason: /usr/lib/libpython2.7.so: cannot open shared object file: No such file or directory {"line":24,"column":32,"sourceURL":"/opt/openwebrtc-0.3/share/seed-gtk3/extensions/Seed.js"}

SrujithPoondla avatar Jan 28 '16 07:01 SrujithPoondla

issue resolved thanks @stefanalund

SrujithPoondla avatar Jan 30 '16 05:01 SrujithPoondla

@SrujithPoondla : please don't ask questions on issues that are unrelated to your problem. Create a new issue instead.

superdump avatar Jan 31 '16 11:01 superdump

sure @superdump

SrujithPoondla avatar Jan 31 '16 15:01 SrujithPoondla