I'm looking to specify the ip address to connect to when doing a web request. Yahoo.com, for instance, has 6 different ip addresses that I can see when making a request - How do I specify which specific ip address I want to use when making the connection?
I've seen a lot of people ask this or similar questions, but have yet to see a focused answer.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://" + urlTextBox.Text);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
response.Close();
IPHostEntry host = Dns.GetHostEntry(response.ResponseUri.Host);
IPAddress[] ipAddresses = host.AddressList;
I'm given back an array of ip addresses just fine - Now how do I choose which one of these I make another specific webrequest to? Thanks in advance!
Point of clarification - I want to specify a specific ip to resolve to, not do any calculations on which to choose or anything