Live data from Hacker News

Show HN: WebRTC signalling data using QR codes

github.com

31–40 of 55 posts

Re: Show HN: WebRTC signalling data using QR codes

#31

Earlier quoted context omitted.

> 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 woul…

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.

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

#34

Earlier quoted context omitted.

This is still WebRTC, so the same limitations apply. The QR codes are used to share the `signalling data` for the WebRTC connection.

More detail: Yes, WebRTC contains several methods for routing through NATs -- ICE, STUN by default (using your browser's default STUN server), optionally TURN.

My browser manufacturer has a STUN server? Where can I find that? (e.g., for Chrome or Firefox)

Edit: AFAICT, this isn't correct. Your browser has no notion of a "default" (or any other) STUN/TURN server. The JavaScript doing WebRTC has to specify one.

That said Google runs one, at stun.l.google.com:19302; but it isn't clear if that's something third-parties could or should make use of (or if Google even permits such activity), though it seems like plenty of examples (and perhaps even real-world uses) make use of it.

Re: Show HN: WebRTC signalling data using QR codes

#35

Nice! I also now of this Android App that uses WebRTC Audio/Video without server (no Internet or DHCP needed): https://github.com/dakhnod/Meshenger I made a submission, in case somebody likes to discuss the need for serverless WebRTC: https://news.ycombinator.com/item?id=18203495 (Disclaimer: I am not the author of the App, but I helped out a bit)

> Contacts are found by taking the devices own IPv6 addresses and replacing the devices own MAC address by the contacts MAC address. You require the devices to be on the same network for this to work right?

Yes, that is (mostly) true.

The App uses ipv6 link local addresses (fe80::.. + mac address). But it also tries to make use the received IPv6 network prefixes. Also, the last contact address is stored. These approaches improves the probability a bit to find the contacts in other networks.

As a side note, many mesh networks are emulating a layer 2 network. With this, everybody can build up their own decentralized telephone network.

Re: Show HN: WebRTC signalling data using QR codes

#38

Earlier quoted context omitted.

More detail: Yes, WebRTC contains several methods for routing through NATs -- ICE, STUN by default (using your browser's default STUN server), optionally TURN.

My browser manufacturer has a STUN server? Where can I find that? (e.g., for Chrome or Firefox) Edit: AFAICT, this isn't correct. Your browser has no notion of a "default" (or any other) STUN/TURN server. The JavaScript doing WebRTC has to specify one. That said Google runs one, at stun.l.google.com:19302; but it isn't clear if that's something third-parties could or should make use of (or if Google even permits such…

In the past, I've seen this Google STUN server used on Chrome when none is supplied by the user JS. This may have changed in recent years.

Re: Show HN: WebRTC signalling data using QR codes

#40

Earlier quoted context omitted.

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 up…

> 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 woul…

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

Post reply on HN