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

I have a question, maybe someone can help me with this...

If i want to ftp file through a proxy server / firewall (not SOCKS ones), how do i do that with this library? Where do i set up the firewall IP address?

And what if the proxy server / firewall requires username and passwod? where do i setup firewall username & password?

Any snippet would be really helpful...

Many thanks
J

9 Answers

0 votes
by
Many firewalls will accept the following for (host,user,password) supplied to edtFTPj's FTPClient:

(firewallmachine, remoteuser@remotehost.com, remotepassword).

i.e. the remote machine is the firewall, the user is the login for the remote machine followed by '@' and then the remote host, and the password is the remote host's password for the user.


Hi,

I have a question, maybe someone can help me with this...

If i want to ftp file through a proxy server / firewall (not SOCKS ones), how do i do that with this library? Where do i set up the firewall IP address?

And what if the proxy server / firewall requires username and passwod? where do i setup firewall username & password?

Any snippet would be really helpful...

Many thanks
J
0 votes
by (200 points)
Thanks for the quick response

Just to confirm, say if:

Firewall IP Address: 111.111.111.111
remote host IP address: 222.222.222.222
remote username: aaa
remote password: bbb

then i can ftp thru the firewall like this:

FTPClient newClient = new FTPClient("111.111.111.111");
newClient.setConnectMode(FTPConnectMode.PASV);
newClient.user("aaa@222.222.222.222");
newClient.password("bbb");

am i right?
0 votes
by
If your firewall supports this, yes.

Thanks for the quick response

Just to confirm, say if:

Firewall IP Address: 111.111.111.111
remote host IP address: 222.222.222.222
remote username: aaa
remote password: bbb

then i can ftp thru the firewall like this:

FTPClient newClient = new FTPClient("111.111.111.111");
newClient.setConnectMode(FTPConnectMode.PASV);
newClient.user("aaa@222.222.222.222");
newClient.password("bbb");

am i right?
0 votes
by
im using edtftp to do ftp for my java program and i just installed WinProxy to test if i could use it through a proxy server.

I did your instruction above using the Proxy IP and Host, Host Username / Password. Somehow i got this error message.


java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.<init>(Socket.java:291)
at java.net.Socket.<init>(Socket.java:147)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.ja
a:143)
at com.enterprisedt.net.ftp.FTPClient.<init>(FTPClient.java:268)
at com.enterprisedt.net.ftp.FTPClient.<init>(FTPClient.java:236)

i tried my browser to connect to internet through the WinProxy (using the same Proxy IP address and port number), they went through alright. So i assume the WinProxy setting is okay? Unless im missing something here...

Any idea?
0 votes
by
We haven't tried WinProxy. You need to ensure that the FTP protocol is configured on it correcly. Also, it may not be listening on port 21, the FTP default. If WinProxy is listening on a different port (probable), you will need to supply this one to the appropriate FTPClient constructor as well.

im using edtftp to do ftp for my java program and i just installed WinProxy to test if i could use it through a proxy server.

I did your instruction above using the Proxy IP and Host, Host Username / Password. Somehow i got this error message.

java.net.ConnectException: Connection refused: connect
i tried my browser to connect to internet through the WinProxy (using the same Proxy IP address and port number), they went through alright. So i assume the WinProxy setting is okay? Unless im missing something here...

Any idea?
0 votes
by
thanks for the tips

the FTP wasnt activated by default, apparently.

just restarted WinProxy with FTP enabled, now it works fine.

is it possible to know the list of proxy/firewall that have been tested? So we could test the one you guys havent tested and post the result here
0 votes
by
The only firewalls I'm aware of for certain that it works for are

- Check Point Firewall-1
- WinProxy (thanks to you)

I *think* it works with most firewalls but if people can post here if they know it works for sure that would be great. Thanks for the idea.

thanks for the tips

the FTP wasnt activated by default, apparently.

just restarted WinProxy with FTP enabled, now it works fine.

is it possible to know the list of proxy/firewall that have been tested? So we could test the one you guys havent tested and post the result here
0 votes
by
what if the proxy requires username and password?

how do we do this?
0 votes
by (161k points)
We've never used one configured to require username/password. Anyone else tried this?

what if the proxy requires username and password?

how do we do this?

Categories

...