3 ms·
It's 2020. Is it finally possible to send a file over the Internet directly from one machine to another? Only if you are not behind symmetric NAT I suppose. T
by api 7y ago
It's 2020. Is it finally possible to send a file over the Internet directly from one machine to another?
Only if you are not behind symmetric NAT I suppose.
Tangent: why does symmetric NAT exist? It seems like the kind of thing firewall fetishists do "for security" without considering the problems it causes and without any clue of what sort of attack it thwarts that mere stateful firewalling does not thwart.
Realize that without symmetric NAT, TURN would be largely unnecessary.
- johnisgood 7y agoI am pretty sure there are many people on here who have not forgotten (it is not even that old! :P) and still use any variations of netcat, or even rsync. Nmap's Ncat is cross-platform (I use MSYS2 on Windows so it does not matter much to me), supports SSL, proxies, connection brokering, and a lot of other stuff[1][2]. [1] https://nmap.org/ncat/guide/ https://nmap.org/ncat/guide/ [2] https://en.wikipedia.org/wiki/Netcat#ncat https://en.wikipedia.org/wiki/Netcat#ncat
- api 7y agoAll that stuff doesn't work between systems behind firewalls or NATs.
- deleted 7y ago[deleted]
- johnisgood 7y ago> A basic file transfer is very simple: Start Ncat in listen mode on one end, start Ncat in connect mode on the other end, and pipe the file over the connection. There are two ways to do this that differ only in which end listens, the sender or the receiver. Sometimes you can't create a listening socket on one end of the transfer because of a lack or permissions, NAT, or filtering. As long as you can listen on at least one end, though, you can use this technique.[1] This works with most if not all netcat implementations. > The basic file transmission technique described at the beginning of this section fails if neither participating host is capable of listening, or the two hosts can't communicate directly. This situation has become common with the prevalence of network address translation. A way to work around it is to use a third host as an intermediary. The intermediate host listens in connection brokering mode and the other two hosts connect to it. Recall from the section called “Connection Brokering” that in connection brokering mode any input received on one socket is copied and sent out to all other sockets. With just two hosts connected this is especially simple: anything coming from one host gets forwarded to the other. This example shows host1 sending inputfile to outputfile on host2, using host3 as an intermediary.[1] This works nicely with Nmap's Ncat. [1] https://nmap.org/ncat/guide/ncat-file-transfer.html https://nmap.org/ncat/guide/ncat-file-transfer.html
- api 7y agoThe second is not direct.
- cyphar 7y agomagic-wormhole solves this problem (while being encrypted and incredibly easy to use). If the two hosts can directly reach each other, it will directly do the transfer, otherwise it uses a public relay server which both hosts can reach.
- cdoxsey 7y agoYou could use https://github.com/rtctunnel/rtctunnel https://github.com/rtctunnel/rtctunnel to setup a proxy over webrtc.