I'm trying to use TOR Browser in my code like this:

Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("", 9150));
//add proxy to some other Java class to use
System.out.println(proxy.address()); //

It would print the locahost address instead of the IP the TOR Browser routes the traffic to. Is there a way to get the later?

  • Are you saying the you want the IP of the guard node? – JSEvans Jan 17 at 22:30
  • @JSEvans I want the IP that the final site that my program connects to, sees – parsecer Jan 18 at 12:41
  • Did you solved your problem ? I face the same issue : I have a Java program which connect to https website. I want to use tor to connect https instead of my own ips. Did you succeed to get Tor Ips ? If yes can you show me how ? Thanks Ben – jamindoStar Mar 29 at 17:26
  • This is not a straightforward thing to do. You probably want to interact with Tor's control protocol. You should watch for stream events and identify the circuit id that belongs to your new stream. Then you can ask Tor for the circuit path and then look up the IP address belonging to the last hop in the circuit. – Steve Mar 29 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.