Skip to main content
specifying the usage of the http protocol within the hostname string leads to a SocketException (SOCKS server general failure)
Source Link

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just need to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("http://facebookcorewwwi"facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just need to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("http://facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just need to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.

added 5 characters in body
Source Link
Mir Saman
  • 368
  • 2
  • 13

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just need to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("http://facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("http://facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just need to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("http://facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.

Source Link
Mir Saman
  • 368
  • 2
  • 13

Just download and run TOR Browser. It will open a socks proxy in your system. You can check the port in browser settings:

enter image description here

You just to set a proxy for your java socket:

InetSocketAddress HiddenerProxyAddress = new InetSocketAddress("127.0.0.1", 9150);
Proxy HiddenProxy = new Proxy(Proxy.Type.SOCKS, HiddenerProxyAddress);
Socket underlying = new Socket(HiddenProxy);
SocketAddress sa = new InetSocketAddress("www.facebook.com", 80);
underlying.connect(sa);

If you want to connect to a hidden service (onion address), you should create an unresolved socket address:

InetSocketAddress sa = InetSocketAddress.createUnresolved("http://facebookcorewwwi.onion", 80);

This is it. Now you can connect using socket through TOR.