简体   繁体   中英

Retrieve destination IP address from OperationContext MessageProperties

I've seen posts on how to retrieve the caller's IP address (RemoteEndpointMessageProperty within MessageProperties within OperationContext) but can't find anything that shows the local IP address involved in the exchange.

For the source IP (ie the caller) I've seen this: WCF 4 Rest Getting IP of Request?

What about getting the destination IP address? Yes, I recognize that it's my IP address, but I want to know which one they used.

You can get information you need from:

OperationContext.Current.RequestContext.RequestMessage.Header.To

There are AbsoluteUri, Host properties

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM