c# - Get IP address used by HttpWebRequest -


i trying reach domain hosted on several ip's. when ip range changes, our firewall block requests since ip not allowed.

the app notify cannot establish connection, not tell ip address trying use.

i using httpwebrequest create request, , httpwebresponse receive response

it doesn't seem httpwebrequest has ip address in property when instantiated url, or after request has been made.

i hesitant see if can httpwebresponse because don't know if have ip address if firewall blocks it.

one example has been mentioned set delegate to:

static void main(string[] args)         {             httpwebrequest req = (httpwebrequest)webrequest.create("http://www.microsoft.com");             req.servicepoint.bindipendpointdelegate = new bindipendpoint(bindipendpoint1);              console.readkey();         }          public static ipendpoint bindipendpoint1(servicepoint servicepoint, ipendpoint remoteendpoint, int retrycount)     {         string ip = remoteendpoint.tostring();         return remoteendpoint;     } 

how ip address of server httpwebrequest connected to?

this seemed work, wanted see if there way without having set delegate. when debugging noticed delegate running constantly, , don't know if issue or not.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -