wormhole-william icon indicating copy to clipboard operation
wormhole-william copied to clipboard

Listen for transit protocol on the receiving side

Open Enrico204 opened this issue 2 years ago • 4 comments

Does wormhole-william supports listening on the receiving side for direct-tcp-v1 connections? By looking at the code it seems that direct-tcp-v1 are supported only when wormhole-william is sending a file

Enrico204 avatar Sep 20 '21 23:09 Enrico204

Currently wormhole-william only listens for direct connections on the sending side, and only try's to establish direct connections from the receiving side. I think this was an intentional simplification, but its also possible it was an oversight at the time.

My intuition is that most users are either on the same network, or both behind a NAT, which is why I suspect this hasn't come up until now.

Adding support for this seems reasonable.

psanford avatar Sep 21 '21 01:09 psanford

I think that your intuition is good - many IPv4 connections are NATted today, and many IPv6 connections are not accepting inbound connections to any ports, by default.

I can try to add this feature in a pull request, if you like :-)

Enrico204 avatar Sep 21 '21 07:09 Enrico204

I think the intuition breaks when one of the sides is behind a public IP address and the other not (for example, when sending data from/to a server). There are also other cases involving firewalls (one device has one and the other doesn't), but actually it doesn't matter that much anymore:

I have worked on some improvements of the connection finding (currently prototyped in Rust). It now does firewall hole punching and NAT traversal, reliably connecting almost any two peers across the internet. I will document it in the protocols very soon. Those changes most probably will require non-trivial refactoring. So I suggest waiting for that, because any efforts that come before this will probably be obsolete by then.

piegamesde avatar Sep 21 '21 11:09 piegamesde

There you go: https://github.com/magic-wormhole/magic-wormhole-protocols/pull/16

@Enrico204 I'd be really interested in your feedback from an implementor's point of view, so please let me know if the text still leaves any questions open.

piegamesde avatar Sep 22 '21 21:09 piegamesde