News for hackers. Stuff that matters.
Re:Show HN: WebRTC signalling data using QR codes by AquiGorka on Friday October 12, 2018 @02:36PM (#18203636)
I've worked with `js-ipfs` and their `js-libp2p`, they use a signalling server (actually two types of them):

- https://github.com/libp2p/js-libp2p-webrtc-star

- https://github.com/libp2p/js-libp2p-websocket-star

That would be going back to using a server for the handshake.

In regards to using a DHT, that's something I have not researched. I am not sure how long an offer is valid, were you thinking of being able to update them as needed whenever you want to establish a connection?

Re:Show HN: WebRTC signalling data using QR codes by kodablah on Friday October 12, 2018 @02:51PM (#18203748)
> In regards to using a DHT, that's something I have not researched. I am not sure how long an offer is valid, were you thinking of being able to update them as needed whenever you want to establish a connection?

Yes. I have toyed with js-libp2p to obtain "providers" based on a key, but I believe the part of js-libp2p that allows you to participate in the DHT isn't quite done [0]. I imagine you'd make a CID that would be a simple hash of some shared string. Then you'd tell the network you are a "provider" with that CID, and when requested, you give the offer (AES'd w/ shared string or other shared secret?). The client can just connect to the same DHT and give the hash and get the (encrypted?) offer. Not sure if IPFS has a way for me to prevent other people from serving/replicating the CID I am serving instead of forcing it to be a hash of the content. A similar approach can happen on BT mainline w/ an infohash maybe.

0 - https://github.com/ipfs/js-ipfs/pull/856

Re:Show HN: WebRTC signalling data using QR codes by smaddock on Saturday October 13, 2018 @02:33AM (#18206754)
I created swarm-peer-server [1] as a way to connect to specific peers over a DHT using a public key known ahead of time. I use this in a networked app I've built to perform WebRTC signaling between peers [2]. The networking and crypto works using modules popular in the Dat Project community.

The challenge is that multiple peers could announce under the same hash on the DHT. Thus I have code to perform a handshake to verify peers upon connecting.

Another project worth mentioning is hyperswarm [3], also created by the Dat Project folks. It's planned to be their new method of connecting peers on a DHT in Beaker Browser.

[1] https://www.npmjs.com/package/swarm-peer-server

[2] https://github.com/samuelmaddock/metastream/blob/master/app/...

[3] https://pfrazee.hashbase.io/blog/hyperswarm

Re:Show HN: WebRTC signalling data using QR codes by AquiGorka on Saturday October 13, 2018 @03:11PM (#18209511)
Thank you for sharing. Metastream is very nice! I thought I was following Paul Frazee's blog but I wasn't (updated my feeds now) so, thanks for the link to the `hyperswarm` post too.
Re:Show HN: WebRTC signalling data using QR codes by AquiGorka on Friday October 12, 2018 @02:57PM (#18203785)
Thank you for sharing, will keep an eye out for that thread.

I did some research a year ago (https://aquigorka.net/post/how-to-find-peers-in-the-decentra...) and going back to it I found this repo that uses the DHT to connect peers: https://github.com/mafintosh/peer-network

The author is one of the main contributors to the Dat project so I'll do some catching up to see what they've come up with.

Re:Show HN: WebRTC signalling data using QR codes by kodablah on Friday October 12, 2018 @03:03PM (#18203834)
Although it uses Tor and is probably outdated, here is a PoC I wrote of bootstrapping a DHT network on the server side and using the client side to discover peers: https://github.com/cretz/tor-dht-poc
Re:Show HN: WebRTC signalling data using QR codes by AquiGorka on Saturday October 13, 2018 @05:05AM (#18207126)
I saw you use IPFS in there, are you sure it did not use one of their signalling servers to find the peers?
Re:Show HN: WebRTC signalling data using QR codes by kodablah on Saturday October 13, 2018 @02:37PM (#18209352)
Used one of my own in Go, in that same repo using IPFS libs. Also, more "bootstrap" server than "signalling" server as its websockets not webrtc.