Re:Magic Wormhole: get things from one computer to another, ...
by lotharrr on Saturday August 17, 2024 @03:30PM
(#41277253)
There are two servers. The "mailbox server" helps with handshakes and metadata transfers, and is super-low bandwidth, a few hundred bytes per connection. The "transit relay helper" is the one that handles the bulk data transfer iff the two sides were unable to establish a direct connection.
I've been meaning to find the time to add NAT-hole-punching for years, but haven't managed it yet. We'd use the mailbox server messages to help the two sides learn about the IP addresses to use. That would increase the percentage of transfers that avoid the relay, but the last I read, something like 20% of peer-pairs would still need the relay, because their NATs are too restrictive.
The relay usage hasn't been expensive enough to worry about, but if it gets more popular, that might change.
Re:Magic Wormhole: get things from one computer to another, ...
by bscphil on Saturday August 17, 2024 @04:37PM
(#41277764)
The folks on the wormhole-rs fork (who appear to share your Github organization? [1]) already have NAT punching working 95+% of the time in my testing, so maybe what they're doing could be ported over to the Python implementation.
Re:Magic Wormhole: get things from one computer to another, ...
by Fnoord on Sunday August 18, 2024 @08:46AM
(#41282062)
The Rust implementation on Tailscale worked well for me. Except on a layer 7 firewall have to be quick to permit the connection or else it tries fallback.
Re:Magic Wormhole: get things from one computer to another, ...
by meejah on Monday August 26, 2024 @12:14PM
(#41358694)
That is just using normal STUN/TURN via another server that one of those developers is running
Re:Magic Wormhole: get things from one computer to another, ...
by from-nibly on Saturday August 17, 2024 @04:45PM
(#41277819)
You cant make a p2p connection over a NAT without exposing a port on the public side of the NAT.
Re:Magic Wormhole: get things from one computer to another, ...
by kccqzy on Saturday August 17, 2024 @06:31PM
(#41278549)
Go check out STUN and ICE.
The best article I've found about NAT traversal is this article from Tailscale: https://tailscale.com/blog/how-nat-traversal-works
Re:Magic Wormhole: get things from one computer to another, ...
by yownie on Sunday August 18, 2024 @01:55AM
(#41280397)
is there a filesize limit for this?
Re:Magic Wormhole: get things from one computer to another, ...
by kccqzy on Sunday August 18, 2024 @12:39PM
(#41283384)
That uses WebRTC, which uses the same NAT traversal tricks.
Re:Magic Wormhole: get things from one computer to another, ...
by Fnoord on Sunday August 18, 2024 @08:51AM
(#41282082)
Not bad, though you don't even need STUN or ICE;
I would have expected the relay server only being used for initial handshake to punch through NAT, after which the transfer is P2P. Only in the case of some network restrictions the data really flows through the relay. How could they afford running the free relay otherwise?