On Friday, March 05, 2004 1:24 PM, Buchanan, Paul wrote:
> I have been trying to establish a ftp connection through a FTP proxy
> using the FTPClient, but as of yet have been unsuccessful. I did
> search the list, but didn't find anything useful.
>
> These are the things I have been trying:
>
> System.getProperties().put( "ftp.proxySet", "true" );
> System.getProperties().put( "ftp.proxyHost", "hostname" );
> System.getProperties().put( "ftp.proxyPort", "21" );
> OR
> System.getProperties().put( "ftProxySet", "true" );
> System.getProperties().put( "ftpProxyHost", "hostname" );
> System.getProperties().put( "ftpProxyPort", "21" );
>
> then the following code:
>
> FTPClient ftp = new FTPClient();
> ftp.addProtocolCommandListener(
> new PrintCommandListener(new PrintWriter(System.out)));
> try
> {
> int reply;
> ftp.connect(mFTPServer);
>
> Neither of those sets of System properties seem to do anything, my
> connections just time out. Is this the correct way of going about
> this?
>
> Thanks,
>
> Paul Buchanan
> West Application Technology
> email: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
Answering my own question:
Since the Net project uses java.net.Socket under the covers, you have to set
up the Socket settings. If the proxy you are using is a SOCKS4 or SOCKS5
proxy, you can set the following System Properties:
System.getProperties().put( "socksProxyPort", "1080");
System.getProperties().put( "socksProxyHost" ,"proxy.host.address");
>From what I can tell, 1080 is the default port for SOCKS proxies. The
following site documents many of the networking System Properties available:
http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html
Hope this helps someone else.
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]