简体   繁体   中英

The client IP address format in a WCF service

I'm using the latest WCF version. I'm getting the client's IP address like that:

        OperationContext context = OperationContext.Current;
        MessageProperties prop = context.IncomingMessageProperties;
        RemoteEndpointMessageProperty endpoint = prop[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
        string ip = endpoint.Address;

The IP I get is:

::1

What does it mean, can someone explain me this format?

Is it because of the binding? I use basicHttpBinding

That is the IPv6 loopback address

https://en.wikipedia.org/wiki/Localhost

ie The client is on the same machine and is connecting to the service using IPv6

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