Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Cannot connect socket through socks proxy

Reply
Thread Tools

Cannot connect socket through socks proxy

 
 
Barney
Guest
Posts: n/a
 
      05-31-2005
Hi,

I'm having problems using the Apache Commons FTPClient to connect to an
external FTP site through a firewall:

System.setProperty("socksProxyHost", proxyUrl);
System.setProperty("socksProxyPort", proxyPort);

FTPClient ftp = new FTPClient();
try {
ftp.connect(url);
...

When I run this, the whole thing just hangs. However, using a
standalong FTP client (SmartFTP) configured with the same settings
works fine.

Using Ethereal, I had a look at the network traffic. The SmartFTP
session connects directly using SOCKS4, whereas the java session first
tries SOCKS5 and then falls back to SOCKS4. This all looks fine. This
level of detail is all getting a bit beyond me, but the problem appears
to be in the SOCKS connection packet being sent.

Successful connection:

Frame 4 (63 bytes on wire, 63 bytes captured)
Ethernet II, Src: 00:0d:56:c5:6c:27, Dst: 00:00:5e:00:01:02
Internet Protocol, Src Addr: <local.ip.address>, Dst Addr:
<proxy.ip.address>
Transmission Control Protocol, Src Port: 4313 (4313), Dst Port: 1080
(1080), Seq: 1, Ack: 1, Len: 9
Socks Protocol
Version: 4
Command: 1 (Connect)
Remote Port: 21
Remote Address: <external.ftp.server>
User Name:

Unsuccessful connection:

Frame 4 (55 bytes on wire, 55 bytes captured)
Ethernet II, Src: 00:0d:56:c5:6c:27, Dst: 00:00:5e:00:01:02
Internet Protocol, <local.ip.address>, Dst Addr: <proxy.ip.address>
Transmission Control Protocol, Src Port: 4600 (4600), Dst Port: 1080
(1080), Seq: 1, Ack: 1, Len: 1
Socks Protocol
Version: 5
[Unreassembled Packet (incorrect TCP checksum): Socks]

Of course, this could all just be an Ethereal problem.

Either way, does anyone have any idea what is going wrong here, and how
I can fix it?

Running on Windows XP Pro
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)

Thanks,

Barney

 
Reply With Quote
 
 
 
 
jainjani jainjani is offline
Junior Member
Join Date: Jul 2006
Posts: 1
 
      07-25-2006
Even i am facing the same problem is anybody has answer to this.....
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
socks proxy and isp logging Anonymous Sender Computer Security 0 09-10-2004 05:48 PM
Help to set up tomcat 4.1.27 behind socks proxy to access database outside the proxy vidy5300 Java 0 06-07-2004 02:23 PM
What is a socks 4/5 proxy server martin Computer Support 6 02-15-2004 11:59 PM
Thread local socks proxy library for java? Chorg Java 1 12-13-2003 11:05 PM
Socks proxy library Kevin Java 0 12-13-2003 08:22 PM



Advertisments