WebRTC signalling?

3,412 views
Skip to first unread message

erichlof

unread,
Oct 25, 2013, 12:15:27 PM10/25/13
to fireba...@googlegroups.com
Hi I'm brand new to Firebase.  The reason I created an account is to host my WebRTC projects with the help of Muaz-Kahn's excellent WebRTC Experiment libraries: https://github.com/muaz-khan/WebRTC-Experiment

I think I need some basic 'signalling' code running on my Firebase.  Is this already under the hood at my personal Firebase, or do I need to add his server-side code to handle signalling as well?  All his code is in JavaScript, so if I DO need that running 24/7 on my Firebase, how do I dump his code on to my Firebase server and start it running so that it can accept connections and be able to set up WebRTC channels between clients (using his library and my client-side code)?

Love your website and service!  Thanks for any help!
-Erich


Anant Narayanan

unread,
Oct 25, 2013, 7:16:44 PM10/25/13
to fireba...@googlegroups.com
Hey Erich,

Firebase is a great fit for WebRTC signaling! You'll be able to use it from client-side code only (JavaScript), a server isn't required.

We built a simple WebRTC app that uses Firebase for signaling: https://github.com/firebase/gupshup - specifically, check out the initiateCall function: https://github.com/firebase/gupshup/blob/gh-pages/js/chat.js#L266 that takes the offer generated by the browser and send it to Firebase. On the other client, you'll be using Firebase to listen for incoming calls: https://github.com/firebase/gupshup/blob/gh-pages/js/chat.js#L129

I haven used Muaz's library but I suspect it works in a similar fashion.

Cheers,
-Anant


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Nelson Cintra

unread,
Mar 11, 2014, 4:08:37 PM3/11/14
to fireba...@googlegroups.com
Hi Anant!

I'm also interested in using firebase for webrtc signaling. The gupshup github project is not available anymore. Any chance in making it available again?

Regards,

Nelson

Szymon Nowak

unread,
Mar 14, 2014, 9:49:27 AM3/14/14
to fireba...@googlegroups.com
I'm currently using Firebase for WebRTC signaling and it's actually pretty easy, though I haven't tested it thoroughly yet, so it may not be bullet proof.

I'm generating user's ID (UUID) and Firebase auth token with this ID on the server. Once the user gets hers ID and auth token from the server, she authenticates to Firebase and starts listening on "/messages/$userid" for 'child_added' event. When other users want to establish peer connection with her, they push messages to "/messages/$userid". On disconnect, she removes hers "/messages/$userid" to make sure that on reconnect she doesn't get the same messages again. I've also got ".read" rule that checks "auth.id", so that user can only read her own messages.

I'm actually using a modified version of PeerJS library for all that. I'll be open sourcing the whole project in a week or so.

Mircea SD

unread,
Apr 8, 2014, 5:17:38 AM4/8/14
to fireba...@googlegroups.com
Hello Szymon Nowak,

I'm writing this to ask you if you finished your project and if the source code is available somewhere.

Szymon Nowak

unread,
Apr 8, 2014, 3:24:19 PM4/8/14
to fireba...@googlegroups.com
On Tuesday, 8 April 2014 11:17:38 UTC+2, Mircea SD wrote:
Hello Szymon Nowak,

I'm writing this to ask you if you finished your project and if the source code is available somewhere.

The app is available at https://www.sharedrop.io and the source code is available at https://github.com/cowbell/sharedrop WebRTC signaling stuff is in https://github.com/cowbell/sharedrop/blob/master/app/scripts/vendor/peer.js#L463-L475 which is a modified version of PeerJS library (http://peerjs.com/). Feel free to ask any questions regarding the code.

Cheers,
Szymon

Mircea SD

unread,
Apr 14, 2014, 8:50:11 AM4/14/14
to fireba...@googlegroups.com
Hello Szymon Nowak,

Thanks for posting the code on github. Only the lines from peer.js#L463-L475 handle the WebRTC signalling through Firebase? I am trying to understand how could I reuse your signalling method in a POC that I must do.

Szymon Nowak

unread,
Apr 14, 2014, 12:26:48 PM4/14/14
to fireba...@googlegroups.com

Mike McDonald

unread,
Jul 29, 2014, 6:00:33 PM7/29/14
to fireba...@googlegroups.com
Nelson,

Anant's personal repo has a copy of gupshup.

Thanks!
--Mike
Reply all
Reply to author
Forward
0 new messages