Rate Your Experience

My Web Application (Code) Uses The IP Address Of Users And Stopped Working With Ezoic?

Modified on: Wed, 13 Jan, 2021

If your application is no longer receiving the correct IP addresses of your visitors and/or is receiving a lot of duplicate IP addresses, it is most likely because your code is not looking at the X-Forwarded-For header (http://en.wikipedia.org/wiki/X-Forwarded-For). 

The X-Forwarded-For header is part of the HTTP standard and is used both by Ezoic and many ISPs world-wide.

Ezoic sends the IP address of the original web visitor through to your server in the X-Forwarded-For header.

In PHP it is available in: $_SERVER['HTTP_X_FORWARDED_FOR']

In .NET its available in HttpContext.Current.Request.Headers["X-Forwarded-For"].

You can read more about implementing the X-Forwarded-For header here: Using the X-Forwarded-For (XFF) Header

Ezoic will also send the actual IP of the user under the request header 'x-middleton-ip'. If you prefer not to use the 'requested-by' header, you can instead locate the actual user IP under this 'x-middleton-ip' header.

Loading ...