Currently I'm crawling multiple website using several threads (URL connection approach) with only single IP address and got block by some websites.
And we want to somehow prevent this problem. Which leads me to think of our virtual machine that has multiple IP addresses.
I'd like to ask is there a way in Java to utilized these local IPs in different URL connections that run under different java threads?
I have tried using proxy, but it seems not working because I believe the local IPs should not be proxied.
Here is what I tried: Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(InetAddress.getByAddress(ip), 8080));
Another solution from Define source ip address using Apache HttpClient does not work because the functions are depreciated.
Much appreciate your knowledge if someone encountered the same scenario.