0

I am using tor socks proxy to retrieve webpage. It's working perfectly on using with some domain name like google.com, but on using with IP address it gives this error

Connection not allowed by ruleset

Is it because Tor proxy doesn't allow to enter IP address directly assuming that user may have resolved the domain's IP address without Tor and their identity can be revealed? If yes, how can I work around this? Or there is something else going on?

int port = onionProxyManager.getIPv4LocalHostSocksPort();
int proxyPort = port;
String proxyHost = "127.0.0.1";
String remoteHost = "https://97.X.X.X";//"google.com";
int remotePort = 8080;

Socks5Proxy socks5Proxy = new Socks5Proxy(proxyHost, proxyPort);
socks5Proxy.resolveAddrLocally(false);
Socket socket = new SocksSocket(socks5Proxy, 
InetAddress.getByName(remoteHost), remotePort);
tarun14110
  • 940
  • 5
  • 26
  • 57
  • `InetAddress.getByName()` expects a hostname rather than a URL so you would want to supply the IP without `http://` or `https://`. That may fix the issue. – drew010 Apr 25 '19 at 21:13
  • @drew010 I tried that too. Was getting the same error. – tarun14110 Apr 25 '19 at 21:21
  • Possibly a duplicate of https://stackoverflow.com/q/29175734/892493 ? Possibly the port you are accessing on that host is closed. – drew010 Apr 25 '19 at 23:17
  • @drew010 I couldn't even connect to google on port 80 or 443 with Google's IP address. – tarun14110 Apr 26 '19 at 01:05

0 Answers0