jlaffaye / ftp

FTP client package for Go
ISC License
1.28k stars 358 forks source link

Fix passive mode with proxy dialer #370

Closed lfreijo closed 5 months ago

lfreijo commented 5 months ago

The current code will return the IP from the dialer function which in the case of a proxy, is the ip of the proxy, not the IP of the remote host. This fixes the issue.

lfreijo commented 5 months ago

This appears to not work as well as I thought it did. This will only work with a socks5 server that allows udp for the dnslookup and most do not. So closing this. I don't see any way using the socks protocol to get the actual remote IP so the only way this would work in that case is to just use the hostname for every connection.