Closed MakarandMane closed 4 years ago
@MakarandMane Thanks for the patch. Since it appears that the Forwarded header may contain additional information, maybe a regex like .*for=(.*?);.*
would be better for picking out the IP from the capture group? According to MDN the format is: Forwarded: by=<identifier>; for=<identifier>; host=<host>; proto=<http|https>
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded
Closing as author never addressed my comment.
@khromov I had tried you suggestion but later did not finalise code. So didnt updated here.
Recently I came to know while using Chrome on android mobile with data saver on. Google proxy server is not adding key HTTP_X_FORWARDED_FOR. I found real IP using HTTP_FORWARDED.