Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.4k views
in Java FTP by (180 points)
Hi,

In the edtFTPj/PRO developer guide the following is under the topic "How to FTP through a SOCKS proxy":

To direct socket communications via a SOCKS proxy, the ProxySettings of the client must be set appropriately. An example is shown below:

ProFTPClient ftp = new ProFTPClient();
ftp.getProxySettings().setProxyAddress("myinternalproxyaddress");
ftp.getProxySettings().setProxyPort(1080);
ftp.getProxySettings().setProxyPassword("myuser");
ftp.getProxySettings().setProxyUserName("mypassword");
ftp.getProxySettings().setPublicProxyAddress("mypublicproxy");
ftp.getProxySettings().setProxyType(ProxyType.SOCKS5);

Note that the public proxy address is generally only required when using FTP in active mode. In this situation, the PORT command must advertise the public proxy address to the FTP server that will be connecting back to the client.

* * *

Can you please clarify the note about the public proxy address. Is it sufficient to simply set the publicProxyAddress when using Active mode or is their additional coding required in order for the PORT command to advertise the public proxy address to the FTP server ?

Also, I don't understand the difference between "myinternalproxyaddress" and "mypublicproxy". Is one an IP and the other a host name ? Are they the same box ? Can you explain the scenario in more detail ?

Thanks,

3 Answers

0 votes
by (162k points)
Yes in active mode the PORT command should supply the public proxy address to the server to connect to. Best to supply an IP address, as the client may not be able to resolve the public proxy address to an IP address.

The internal proxy address is the address that the client can use to contact the proxy. It is probably an internal network address. The public address is what the proxy displays to external clients (it's probably a different network interface on the proxy machine).
0 votes
by (180 points)
Just to be sure, I do not need to do any additional coding other than coding this one additional line (in active mode), correct ? In other words, by supplying this line, the ProFTPClient code will take care of executing the PORT command correct ? If additional coding is needed, please provide example.

ftp.getProxySettings().setPublicProxyAddress("mypublicproxy");

Thanks,
0 votes
by (162k points)
It should work, yes. But we haven't tested all proxy servers, so we can't guarantee it. For example, your proxy must support active mode.

Categories

...