How to preserve client IP after WCF routing?

I currently have a WCF service that can get the client IP using the following code:

    private static string GetClientIPAddress()
    {
        RemoteEndpointMessageProperty clientEndpoint =
            OperationContext.Current.IncomingMessageProperties[
            RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

        return clientEndpoint.Address;
    }

      

However, when we put the WCF Routing Service in front of the existing service, we now find that the specified IP address is the address of the server that hosts the routing service.

Is it possible that the client's IP address will be saved in full?

+3


source to share





All Articles