Discuss edtFTPj (FTP) and edtFTPj/PRO (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

viachi

set ftp connection going out through proxy on defined port ?

by viachi » Wed Jul 28, 2004 10:44 pm

hi :)

i am trying to make the ftp client going out through proxy (Proxy+ 3.0). The proxy can be set to use defined port but the ftp connection accures on variables. The proxy is working fine with the web browser, so i have to find solution in the ftp client.
any ideas ?????
thanks :)
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: set ftp connection going out through proxy on defined po

by support2 » Wed Jul 28, 2004 11:05 pm

Have you read the developers guide? There's a section there on using a proxy I believe

http://www.enterprisedt.com/products/ed ... ation.html

viachi wrote:hi :)

i am trying to make the ftp client going out through proxy (Proxy+ 3.0). The proxy can be set to use defined port but the ftp connection accures on variables. The proxy is working fine with the web browser, so i have to find solution in the ftp client.
any ideas ?????
thanks :)
no avatar
User

viachi

by viachi » Wed Jul 28, 2004 11:27 pm

no effect :(
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

by support2 » Thu Jul 29, 2004 12:39 am

Using 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.

viachi wrote:no effect :(
no avatar
User

uzimmi

Posts

8

Joined

Wed Aug 04, 2004 6:19 pm

Location

Germany / Hessen

same problem ?!

by uzimmi » Wed Aug 04, 2004 6:47 pm

Hi,

I have the same problem. I must use a http-proxy which can be conntected only via the port 8080 (no password and user required). Reading the documentation of edtFTPj, I found your hint using the constructor with parameters FTPClient(firewallmachine, remoteuser@remotehost.com, remotepassword) - but:

- in the JavaDoc no such cunstructor is specified!
- how should the port of the proxy be defined?

By the way, my tests using java classes java.net.URL and java.net.URLConnection to access the ftp-server via the http-proxy has been successful.

support2 wrote:Using 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.

viachi wrote:no effect :(
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: same problem ?!

by support2 » Wed Aug 04, 2004 6:58 pm

What it is saying is use the firewall machine as the host to connect to, and use remoteuser@remotehost.com as the user, and remotepassword as the password.

One of the FTPClient constructors allows you to supply a port number along with the host (which should be the firewall).

uzimmi wrote:Hi,

I have the same problem. I must use a http-proxy which can be conntected only via the port 8080 (no password and user required). Reading the documentation of edtFTPj, I found your hint using the constructor with parameters FTPClient(firewallmachine, remoteuser@remotehost.com, remotepassword) - but:

- in the JavaDoc no such cunstructor is specified!
- how should the port of the proxy be defined?

By the way, my tests using java classes java.net.URL and java.net.URLConnection to access the ftp-server via the http-proxy has been successful.

support2 wrote:Using 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.

viachi wrote:no effect :(
no avatar
User

uzimmi

Posts

8

Joined

Wed Aug 04, 2004 6:19 pm

Location

Germany / Hessen

Re: same problem ?!

by uzimmi » Wed Aug 04, 2004 7:45 pm

The problem is the connect to the proxy. I use this code:

FTPClient ftp = new FTPClient("194.39.156.90", 8080);

2 Minutes later (timeout ?) I get the following IOException:
- Unexpected null reply received

Additionally I tried to define some VM-Parameters with the same result (helpful with URL classes):
-DproxyHost=194.39.156.90 -DproxyPort=8080
-DftpProxyHost=194.39.156.90 -DftpProxyPort=8080


support2 wrote:What it is saying is use the firewall machine as the host to connect to, and use remoteuser@remotehost.com as the user, and remotepassword as the password.

One of the FTPClient constructors allows you to supply a port number along with the host (which should be the firewall).

uzimmi wrote:Hi,

I have the same problem. I must use a http-proxy which can be conntected only via the port 8080 (no password and user required). Reading the documentation of edtFTPj, I found your hint using the constructor with parameters FTPClient(firewallmachine, remoteuser@remotehost.com, remotepassword) - but:

- in the JavaDoc no such cunstructor is specified!
- how should the port of the proxy be defined?

By the way, my tests using java classes java.net.URL and java.net.URLConnection to access the ftp-server via the http-proxy has been successful.

support2 wrote:Using 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.

viachi wrote:no effect :(
no avatar
User

uzimmi

Posts

8

Joined

Wed Aug 04, 2004 6:19 pm

Location

Germany / Hessen

Re: same problem ?!

by uzimmi » Fri Aug 06, 2004 2:58 pm

:?: Do you need more information for solving the problem :?:

:!: Please tell me, how I can assist with tests or anything else :!:


uzimmi wrote:The problem is the connect to the proxy. I use this code:

FTPClient ftp = new FTPClient("194.39.156.90", 8080);

2 Minutes later (timeout ?) I get the following IOException:
- Unexpected null reply received

Additionally I tried to define some VM-Parameters with the same result (helpful with URL classes):
-DproxyHost=194.39.156.90 -DproxyPort=8080
-DftpProxyHost=194.39.156.90 -DftpProxyPort=8080


support2 wrote:What it is saying is use the firewall machine as the host to connect to, and use remoteuser@remotehost.com as the user, and remotepassword as the password.

One of the FTPClient constructors allows you to supply a port number along with the host (which should be the firewall).

no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: same problem ?!

by support2 » Sat Aug 07, 2004 3:13 am

It is possible that your firewall/proxy isn't configured for FTP access. Can you FTP from the command-line out to a external host?

uzimmi wrote::?: Do you need more information for solving the problem :?:

:!: Please tell me, how I can assist with tests or anything else :!:

no avatar
User

uzimmi

Posts

8

Joined

Wed Aug 04, 2004 6:19 pm

Location

Germany / Hessen

Re: same problem ?!

by uzimmi » Sat Aug 07, 2004 5:27 pm

I think, my proxy is not configured for FTP access. Therefore a http-tunnel must be used. I found this hint:

FTP does indeed work with HTTP-Tunnel's service, but you must set your FTP client software to PASV mode and SOCKS 4/5 proxy 127.0.0.1 with port 1080.

Unfortunately the FTPClient class has no constructor with connection mode as parameter. I can set the SOCKS proxy, but the constructor FTPClient(host, port) will do his connect with the default connection mode, and this may be the ACTIVE mode. So I am not able to test it.

support2 wrote:It is possible that your firewall/proxy isn't configured for FTP access. Can you FTP from the command-line out to a external host?
[/i]
no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: same problem ?!

by support2 » Sat Aug 07, 2004 5:49 pm

The connection mode is irrelevant when logging in - it is only used for data transfers such as get/put and directory listing.

So set the SOCKS proxy first - it's a static method - and then call the constructor.

After logging in change to PASV.

uzimmi wrote:I think, my proxy is not configured for FTP access. Therefore a http-tunnel must be used. I found this hint:

FTP does indeed work with HTTP-Tunnel's service, but you must set your FTP client software to PASV mode and SOCKS 4/5 proxy 127.0.0.1 with port 1080.

Unfortunately the FTPClient class has no constructor with connection mode as parameter. I can set the SOCKS proxy, but the constructor FTPClient(host, port) will do his connect with the default connection mode, and this may be the ACTIVE mode. So I am not able to test it.

support2 wrote:It is possible that your firewall/proxy isn't configured for FTP access. Can you FTP from the command-line out to a external host?
[/i]
no avatar
User

uzimmi

Posts

8

Joined

Wed Aug 04, 2004 6:19 pm

Location

Germany / Hessen

Re: same problem ?!

by uzimmi » Sat Aug 07, 2004 6:40 pm

OK, but my test failed with a connection refused exception. This attempt may be the wrong :cry:

I don't understand, why browsers (IE, Netscape) or some tools (e.g. Total Commander) can work with our proxy to handle FTP, but not your library or some other tools (e.g. WS_FTP).


support2 wrote:The connection mode is irrelevant when logging in - it is only used for data transfers such as get/put and directory listing.

So set the SOCKS proxy first - it's a static method - and then call the constructor.

After logging in change to PASV.

no avatar
User

support2

Posts

3869

Joined

Tue May 18, 2004 8:30 am

Re: same problem ?!

by support2 » Mon Aug 09, 2004 7:36 pm

Sorry, we don't know why either!

If you find out, please post the solution here.

uzimmi wrote:OK, but my test failed with a connection refused exception. This attempt may be the wrong :cry:

I don't understand, why browsers (IE, Netscape) or some tools (e.g. Total Commander) can work with our proxy to handle FTP, but not your library or some other tools (e.g. WS_FTP).
no avatar
User

uzimmi

Posts

8

Joined

Wed Aug 04, 2004 6:19 pm

Location

Germany / Hessen

Re: same problem ?!

by uzimmi » Mon Aug 09, 2004 10:24 pm

The result of some additional tests using the debugger:

First problem is, that the proxy delivers no response after socket connet. Therefore I disabled the method call validateConnection() in the constructor of FTPControlSocket().

The next problem may be the ftp-communication throught the http-proxy. Login e.g. with ftp.login("ftp.microsoft.com", ""); returns an error 400 created by the proxy and login with ftp.login("ftp://ftp.microsoft.com", ""); delivers no response.

May be the Total Commander communicates with pure http and evaluates the http structured answer. I fear, this is the only possible way :cry:

support2 wrote:Sorry, we don't know why either!

If you find out, please post the solution here.

uzimmi wrote:OK, but my test failed with a connection refused exception. This attempt may be the wrong :cry:

I don't understand, why browsers (IE, Netscape) or some tools (e.g. Total Commander) can work with our proxy to handle FTP, but not your library or some other tools (e.g. WS_FTP).
no avatar
User

Guest

by Guest » Tue Aug 10, 2004 3:22 am

Is an HTTP Proxy supported at all? The built in SOCKS methods only apply to a SOCKS v4/v5 firewall, but many companies use http proxies (with or without ftp support).

Also, setting the htp/ftp proxy via system properties doesn't seem to influence the ftp class since it's based on Sockets directly.
Next

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign