Re: javaprogram using tor

2007-12-02 Thread coderman
On Nov 1, 2007 2:02 PM, Frozen Flame <[EMAIL PROTECTED]> wrote:
> You can use a java socks api or use an external app, such as tsocks
> (Linux) to socksify your app without it even knowing about it.

my understanding is that doing DNS resolution via tsocks is spotty at
best since it forces the resolver library to use TCP which may not be
reliable.  it is better to have the application use socks 4a, socks 5
with names, or perhaps a transparent Tor proxy.

best regards,


Re: javaprogram using tor

2007-12-02 Thread coderman
On Oct 28, 2007 12:36 PM, Juliusz Chroboczek <[EMAIL PROTECTED]> wrote:
> [ configuring SOCKS in java ]

you can also use the system and/or user level deployment properties
file to set the SOCKS proxy settings:
http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html


> Note however that Java most probably implements SOCKS with IP
> addresses, and unless you take special precautions, you will suffer
> from DNS leaks.  Which may or may not be a problem for your application.

this is correct.  the only way to do this securely is via transparent Tor proxy.
(it may be possible to implement your own lookups through Tor via JNDI
naming service hooks, but this would require a significant effort and
still leave you vulnerable to third party jars and such...)

best regards,


Re: javaprogram using tor

2007-11-01 Thread Frozen Flame
You can use a java socks api or use an external app, such as tsocks (Linux) 
to socksify your app without it even knowing about it. 



 __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: javaprogram using tor

2007-10-28 Thread Juliusz Chroboczek
> i have searched the FAQ's and find the Torlib, and i cannot find
> where to download it or any sample of it.  And cannot find exactly
> how can i use it in my program.  Is there any other way to connect
> my java program to "tor", or kindly point me to something useful..

Tor appears to client applications as a SOCKS proxy.  Sun's JDK can
speak SOCKS out of the box if you set the system properties
socksProxyHost and socksProxyPort.

So I believe that your Java application will automatically go through
tor if you do

  java -DsocksProxyHost=localhost -DsocksProxyPort=9050 AlicesRestaurant

Alternatively, you could modify your application to explicitly use
a SOCKS proxy by creating your sockets as so:

  new Socket(new Proxy(Proxy.Type.SOCKS,
   new InetSocketAddress("127.0.0.1", 9050)));

Note however that Java most probably implements SOCKS with IP
addresses, and unless you take special precautions, you will suffer
from DNS leaks.  Which may or may not be a problem for your application.

Juliusz