[p2p-hackers] Socks and Java

Davide "dada" Carboni dcarboni at gmail.com
Mon Apr 3 17:03:19 UTC 2006


Hi, I'm trying to play with SOCKS in Java and I found very easy to
force connections to go via a SOCKS server. For instance the CONNECT
is just a matter of few lines of code:

SocketAddress addr = new InetSocketAddress("socks.mydomain.com", 1080);
Proxy proxy = new Proxy(Proxy.Type.SOCKS, addr);
URL url = new URL("ftp://ftp.gnu.org/README");
URLConnection conn = url.openConnection(proxy);

What I cannot understand is how to use SOCKS also for binding an
application behind a firewall to a given port. In other words how to
use the BIND operation in SOCKS. I know that with
jsocks.sourceforge.net is possible to instantiate a special
SocksServerSocket to socksfy server sockets, but what I'm asking here
is if it is possible also with the standard Java API.

TIA
Bye.

--
Prima il 30% poi Barbolomeo.
--
http://people.crs4.it/dcarboni



More information about the P2p-hackers mailing list