0

Is there a possibility to have an FTPS server connection via proxy with authentication?

To connect to normal FTP Server with proxy authentication, I used FTPHTTPClient from Apache Commons. But, I couldn't find a way to set proxy details within FTPSClient. Can someone please guide me in the right direction?

Thanks.

1 Answers1

0

From the FTPHTTPClient docs, it looks like you would use:

// If you are proxying via HTTP CONNECT, use port 80.
String proxyHost = "proxy.example.com";
int proxyPort = 80;
FTPHTTPClient client = new FTPHTTPClient(proxyHost, proxyPort);

String realHost = "ftp.example.com";
int realPort = 21;
client.connect(realHost, realPort);

Hope this helps!

Castaglia
  • 2,972
  • 5
  • 28
  • 49