Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.6k views
in Java FTP by (500 points)
Hello,

First excuse my english, i'm french and i don't speak a really good english :)

So I use edtFTPj on a applet, and i need to connect to my ftp server through a socks proxy with no authentication. But i have a NoRouteToHostException. I search on this forum but i found no answers. Actually to make my tests, i have 2 networks, aparted by the proxy : my server is on 172.16.7.* and the client i want to connect is on 192.168.200.*. So for my client there is this settings :
socks adress : 192.168.200.1
socks port : 1080
ftp host : 172.16.7.137

I use this code :
FTPClient.initSOCKS("1080","192.168.200.1");
ftp = new FTPClient();
ftp.setRemoteHost("172.16.7.137");
ftp.connect();

I don't understand : the code is really simple, i don't know what i need to do more...

Thank you for help

12 Answers

0 votes
by (161k points)
Have you successfully FTP'd to your host via the proxy with any client, e.g. Filezilla?
0 votes
by (500 points)
Thank you for your answer,

Yes, Filezilla configured with the socks proxy hosts with no problems... So an other idea ?
0 votes
by (500 points)
I have still the problem... Is it possible that the proxy's firewall is involved in ? But FileZilla connects with no problem, so I don't think it is that the problem.
0 votes
by (161k points)
Have you tried connecting in a simple app that isn't part of an applet? Can you post the stack trace?
0 votes
by (500 points)
I understand you think it is the applet which create problem. I'll try connection out of the applet.
But today my company is performing maintenace on my server, so i need to wait tomorrow to test it. I'll post when it'll be done.
Thanks for your answers.
0 votes
by (500 points)
Hello !

So i tested out of the applet, and the same code has connected successfuly ! Good but... now the question is why the library doesn't support java applet ? And how conturn this problem ?
I hope there is an alternative, anyway the problem is interesting...

For the applet, I'll post the stack trace tomorow.
0 votes
by (500 points)
This is the stack trace when the applet try to connect :
java.net.NoRouteToHostException: No route to host: connect
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(Unknown Source)
   at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
   at java.net.PlainSocketImpl.connect(Unknown Source)
   at java.net.SocksSocketImpl.connect(Unknown Source)
   at java.net.Socket.connect(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.enterprisedt.net.ftp.SocketUtils.createSocket(SocketUtils.java:91)
   at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.java:290)
   at com.enterprisedt.net.ftp.FTPClient.connect(FTPClient.java:849)
   at FilesToUpload.connect(FilesToUpload.java:79)
0 votes
by (161k points)
It may be an applet permissioning problem - try granting all permissions to the applet. Normally applets are restricted in the network operations they can do.
0 votes
by (500 points)
To allowed the applet to access client's HDD or network, it must be signed. I searched informations about it, and the signature allowed it. Effectively, my applet is already signed, and without proxy, the applet connects without problems to the ftp.
It is an arcane problem... I continues to search answers, but if you have an idea... :)
0 votes
by (500 points)
I tried to see what request the proxy receives :
When i try connect out of the applet, the proxy receives a SOCKS request (and the connection success).
But the same code executed by the applet send a request on the port 21... So the proxy refused it.
How is it possible ?

Categories

...