Home

Awesome

WebRTC IPFS Signaling

This project is a proof of concept to see whether we can use IPFS to do WebRTC signaling obviating the need for a separate server.

Goal 1 - Browser to Browser Signaling

Status: Accomplished

I currently have debugging turned on so the console logs do show some details. Steps:

Navigate to https://cretz.github.io/webrtc-ipfs-signaling/browser-offer.html. It will update the URL w/ a randm hash. (Of course, you could navigate to a hand-entered URL hash on a fresh tab). Take the URL given on that page and, in theory, open it up with the latest Chrome or FF anywhere in the world (that doesn't require TURN). After a few seconds, the offer/answer will communicate and WebRTC will be connected.

Quick notes:

How it Works

It's quite simple. Both sides subscribe to a pubsub topic named after the preshared identifier. Then I just send JSON'd RTCSessionDescriptions back and forth. Specifically, the offer side sends the offer every two seconds until it gets an answer whereas the answer side waits for an offer then sends an answer.

Goal 2 - Browser to Native App Signaling

Status: Failing

I was pretty sure I could easily hook up ipfs/go-ipfs with pions/webrtc and be all good. Although pions/webrtc is beautifully built, go-ipfs is not and very much not developer friendly for reading code or embedding. I was forced to use ipsn/go-ipfs which re-best-practicizes the deps. I have the code at cli_offer.go and while it looks right, the JS side cannot see the pubsub messages. I have a lot of annoying debugging to do in that unfriendly codebase.