8 ms·
Peerfetch – Peer-to-Peer HTTP over WebRTC
- meiraleal 2y agoIt is really annoying when someone posts an interesting project and HN has a big discussion but when I get to try to lib, it is unmaintained and the last update was 3 years ago. There were great recommendations in this thread tho, thanks a lot! This one looks good: https://github.com/subins2000/p2pt https://github.com/subins2000/p2pt
- localfirst 2y agogot excited but the repo hasn't been updated for over 3 years.
- chfritz 2y agoUsing webrtc is actually overkill in this case. What you really want is just the ICE part used by webrtc to establish a peer-to-peer connection. That's what tailscale does, too. Webrtc then adds a lot of media-related protocols on top of that connection, which, of course, the Peerfetch application doesn't care about.
- robertclaus 2y agoClever idea. Begs the question of why you would use http if you already have a bidirectional webRTC connection, but I guess it depends on the application.
- throwawaymaths 2y agoYou can securely serve a webpage from a server behind NAT without creating a VPN and without https certificated
- dlenski 2y agoI suppose the persistence of IPv4 has broken all of our brains, but with IPv6 you can just Not Have NAT, and just have normal end-to-end connectivity to any random box in your home from outside. (And yes, I do this. Works great.)
- ycombinatrix 2y agoThis supports UDP/unreliable data streams in the browser tho.
- throwawaymaths 2y agoThere's something nice about being anonymous behind a communal v4 gateway. Also can you get an tls cert for a ipv6 number address? Or are you punching through using only ssh or unencrypted stuff?
- dgl 2y ago> There's something nice about being anonymous behind a communal v4 gateway. IPv6 lets you do this -- nearly every client will use privacy addressing, so your (default) source address rotates daily. However you can still connect to the machine on its main (non-privacy protected) IPv6 address.
- _zoltan_ 2y agoYou miss the point: that /56 or /64 is still assigned to you, while a NAT gw might serve 1000s of people.
- chgs 2y agoThe /64 doesn’t change, it’s unique to your network. It’s broadly equivelent of the /32 you get. CGNat adds a layer of privacy that a public /32 (ipv4) or /64 (ipv6) doesn’t give.
- whitehexagon 2y agoIs there a way to do this without the signaling server?
- dmotz 2y agoYou might be interested in my side project Trystero https://github.com/dmotz/trystero https://github.com/dmotz/trystero It abstracts away the work of signaling and connects peers via open decentralized networks like BitTorrent, Nostr, MQTT, IPFS, etc.
- fullspectrumdev 2y agoNot had time to read through the docs properly, but would this work for CLI apps (Node compiled to an executable?) or similar? The problems this solves look interesting for a few CLI tools I want to build :)
- evbogue 2y agoI am also curious about the progress on this feature: https://github.com/dmotz/trystero/issues/24 https://github.com/dmotz/trystero/issues/24 for more info
- turblety 2y agoI think the closest you might get is something like the bittorrent dht. There are still bootstrap servers for the first few connections, but there's really no getting away from that, right? https://github.com/webtorrent/bittorrent-dht https://github.com/webtorrent/bittorrent-dht
- tfolbrecht 2y agoNot with the three major browsers and NAT unfortunately. https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Protocols https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/...
- wuiheerfoj 2y agocheck out NAT hole-punching in libp2p: https://docs.libp2p.io/concepts/nat/hole-punching/ https://docs.libp2p.io/concepts/nat/hole-punching/ scroll down a bit for the STUNless/TURNless bit
- sitkack 2y agohttps://github.com/webtorrent/webtorrent https://github.com/webtorrent/webtorrent https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=webtorrent&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
- tarasglek 2y agoDoing http over webrtc is how https://camect.com https://camect.com works to let one access cameras own private server via their ui. They have a centralized bit for auth and then use webrtc and a physical nvr to serve your videos maximally efficiently...so there is low risk of their cloud becoming a financial burden that they cancel ala google nest cams It's a super nice architecture
- cyanydeez 2y agoHow soon do you think IT will clamp down on webrtc?
- kabes 2y agoSo from your explanation I get that they use webrtc for videos. But then what do they use http over webrtc for? Do they serve the UI as well over webrtc?
- tarasglek 2y agoTheir ui is also hosted on the nvr, they serve ui assets over webrtc
- londons_explore 2y ago> have a centralized bit for auth Theoretically they could get the camera itself do auth, and then the server becomes fully 'dumb', and need not even be service specific.
- tehlike 2y agoOauth is nice and convenient.
- Saris 2y agoSounds kind of similar to Frigate but packaged up ready to go, neat.
- tehlike 2y ago
- lerpgame 2y agoits advertising that it’s secure e2e even behind firewall/etc but that’s not true because webrtc will fallback to using TURN server to relay when other methods fail which will break the encryption, just fyi.
- strbean 2y agoYou can pass configuration to disable ICE entirely. Looks like it's using PeerJS, which defaults to a config of using a Google STUN server and no TURN servers. Not sure if using a STUN server compromises the E2E in some way?
- server_man3000 2y agoWhy would STUN compromise e2e? STUN just returns your IP
- strbean 2y agoI just didn't want to speculate, as I'm not familiar with the security considerations here. But, thinking about it a bit, couldn't a compromised STUN server establish a MITM by lying to you about your IP, and then relaying to you? This old HN comment describes it: https://news.ycombinator.com/item?id=11192610 https://news.ycombinator.com/item?id=11192610 I don't know if this would break the E2EE here (although if it wouldn't, I'm not sure how a TURN server would either, as that's just a baked in MITM).
- WatchDog 2y agoWebRTC won’t use TURN unless it’s explicitly configured with a TURN server. Even if it did use a TURN server webrtc is still e2e encrypted. You need to trust the signalling server though. This library seems to do a few other things, which maybe reduces the trust in the signalling server, but I didn’t really read it in enough detail to comment on it.
- lerpgame 2y agoi was wrong actually, it doesn’t weaken security as long as the data is encrypted either using DLTS or application layer encryption, please ignore my comment lol.
- thoronton 2y agoI don't get it. Where is the signaling server and how is it working?
- etherdream 2y agoI have tried this idea before, combining Service Worker to implement a decentralized website.
- thrdbndndn 2y ago(Aside) speaking of WebRTC, but is there any solution to record videos that is done by webRTC? There are already more than enough tools that can record HLS and Dash, but I haven't find anything, not even PoC that can record video streams transited via WebRTC (e.g. agora.io).
- jiehong 2y agoNice! Although, an alternative is something like Tailscale.