Hi All,
Is it possible to specify the IP address a WebRequest should use when creating a connection to a remote resource? For example, I have an MVC 2 website which runs on IP 0.0.0.10
, but the server has 0.0.0.1 - 0.0.0.10
assigned to it. In the website there is a class that will be initialized based on user input and it will create requests to remote resources.
The problem I'm having is that the WebRequest is most likely using 0.0.0.1
as it is the first IP of the server instead of the IP of the website, thus causing requests to be blocked from remote resources that filter by IPs...
So, is there a way to specify the IP the WebRequest should use when performing the request. Alternativelly, it doesn't have to be a solution for WebRequest, it can be a solution for HttpWebRequest, or if need be something else. If I have to I will alter the code for the requests/responses.
Anyway, help would be much appreciated! Thanks in advance!