WCF – Get Client Header
try { IncomingWebRequestContext request = WebOperationContext.Current.IncomingRequest; WebHeaderCollection headers = request.Headers; foreach (string headerName in headers.AllKeys) { if (headerName != "X-Forwarded-For") { continue; } return headers[headerName]; } } catch (Exception) { }