OperationContext context = OperationContext.Current;
MessageProperties properties = context.IncomingMessageProperties;
RemoteEndpointMessageProperty endpoint =
properties[RemoteEndpointMessageProperty.Name] as
RemoteEndpointMessageProperty;
if (endpoint != null)
{
IP = string.Concat(endpoint.Address, ":", endpoint.Port);
}
However, since the WCF service is hosted in IIS behind a load balancer, the
IP address I got is always the IP of the load balancer.
Is there any way to get around this so that I can get the true IP of the
client?
Thanks