简体   繁体   English

从OperationContext MessageProperties中检索目标IP地址

[英]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. 我看过有关如何检索呼叫者IP地址(OperationContext中MessageProperties中的RemoteEndpointMessageProperty)的帖子,但是找不到任何显示交换涉及的本地IP地址的信息。

For the source IP (ie the caller) I've seen this: WCF 4 Rest Getting IP of Request? 对于源IP(即呼叫方),我已经看到了这一点: WCF 4剩余获取请求的IP?

What about getting the destination IP address? 如何获得目标IP地址? Yes, I recognize that it's my IP address, but I want to know which one they used. 是的,我知道这是我的IP地址,但我想知道他们使用了哪个IP地址。

You can get information you need from: 您可以从以下位置获取所需信息:

OperationContext.Current.RequestContext.RequestMessage.Header.To

There are AbsoluteUri, Host properties 有AbsoluteUri,主机属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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