Dear Forum Members,
I need some advice on how best to run Tor in Java when using TorLib to avoid DNS leaks. My difficulty is how to use the TorLib class in the code snippet below to connect to a webserver:
.....
String url = "http://www.abc.com/index.html",
URL server = new URL(url);
Properties systemProperties = System.getProperties();
systemProperties.setProperty("socks.ProxyHost","localhost");
systemProperties.setProperty("socks.ProxyPort",9050);
HttpURLConnection connection = (HttpURLConnection) server.openConnection();
......
Do I need to instantiate a new socket and how to use it to point to Tor?
Apologies for asking Tor question in a Java Forum since I could not find the right forum. It would be great if you could direct me to one.
Any assistance would be appreciated.
Thanks,
Jack