Johnathan Au
Johnathan Au

Reputation: 5362

How can I get the client's IP address if I am using HTTPS?

If I am using HTTP I can get the normal IP address but if I am using HTTPS it returns the proxy server's IP address. How can I get the IP address of the client and not the proxy server?

Upvotes: 0

Views: 429

Answers (1)

stringy05
stringy05

Reputation: 7067

A proxy will generally add a X-Forwarded-For header see here which will contain the IP address of the real client.

Note there's no difference between HTTP and HTTPS in terms of the IP addresses you can see on a request, they will both give you the IP address of the User-Agent that originated the request.

Upvotes: 4

Related Questions