There are many guides on how to download a web page, given its URL in java. In this case, the web page is downloaded from a server provided by the DNS (which returns the ip of one of the servers hosting the web page).
My question is - given a specific IP of a server, how can I download a web page hosted in the specific server using its URL ?
In order to clarify the question, consider a web site like google, which is hosted by multiple servers. If I were to download the web page using the 'www.google.com' URL alone, I would be provided with the web page from one of the hosting servers (which the DNS would select). However, assume I have the IP of one of the servers hosting www.google.com
and I wish to download the web page specifically from that server - I would not be able to use the URL alone since I would not have any guarantees that I downloaded the web page from the correct server.
A complete answer to this question should also support HTTPS protocols.