commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex HO" <alexk...@gmail.com>
Subject Re: connect to ftp server via proxy..
Date Wed, 16 Aug 2006 08:40:46 GMT
hi rory,

thx ur prompt response,
but the link  http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=107877944806547&w=2
states that FTPClient can connect via ftp proxy, am i correct?
and i have tried to switch the proxy to a open src one callled java
socks server, http://jsocks.sourceforge.net/
luckily it seems work for my code,
i can now on connect to the proxy and then ftp to the target ftp
account. i suspect there is problems in my previous proxy
server(BPSlite). i am trying to figure out the problems. i attached is
ftpclient code
hope this help

alex

On 8/16/06, Rory Winston <rwinston@eircom.net> wrote:
> Hi Alex
>
> The FTPClient library isn't capable of FTP transactions thru a proxy at present (unless
there is some external trickery that I'm not aware of that would facilitate this). This wouldn't
require a huge amount of extra effort - I've looked at how Sun have implemented it for their
internal JDK FTP client, but unfortunately it's not something that's there now.
>
> Rory
>
> "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org> wrote:
>
> >
> > hi all,
> > i am developing a ftpclient.java using commons-net-1.4.1.jar library.
> >
> > it works fine if not via proxy server. it can login the ftp account
> > and list files. But my target is to connect the ftp server via proxy
> > server.
> >
> > by following the Paul Buchana
> > here:  http://marc.theaimsgroup.com/?l=jakarta-commons-user&m=107877944806547&w=2
> > i add the following two lines before the connect line
> > System.getProperties().put( "socksProxyPort", "7200");
> > System.getProperties().put( "socksProxyHost" ,"25.10.22.11"); //
> > 25.10.22.11 is proxy server with port 7200
> >
> > prv_cls_ftpclient.connect("25.10.22.13",21); <-- target ftp server to
> > connect, it can connect to ftp server if comment the above
> > System.getProperties lines
> > reply = prv_cls_ftpclient.getReplyCode();
> > System.out.print("Print log reply code"+reply);
> > if(!FTPReply.isPositiveCompletion(reply)) {
> >         prv_cls_ftpclient.disconnect();
> >         System.err.println("FTP server refused connection.");
> >         System.exit(1);
> > }
> > System.out.print("Print log Connection");
> > prv_cls_ftpclient.login("user", "pass");
> >
> > but it stop at the .connect line without further proceed, what's wrong
> > with my code. any miss setting i should did?? or is it possible to a
> > ftp server via a proxy server?
> >
> > I am using a lite proxy server called Binary Proxy Server BPSLite.exe on windows
> > --
> > Regards,
> > Alex
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
>
>
>
> -----------------------------------------------------------------
> Find the home of your dreams with eircom net property
> Sign up for email alerts now http://www.eircom.net/propertyalerts
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


-- 
Regards,
Alex

Mime
View raw message