Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getClienIPAddress helper #48

Closed
sergiodxa opened this issue Mar 3, 2022 · 5 comments · Fixed by #50
Closed

Add getClienIPAddress helper #48

sergiodxa opened this issue Mar 3, 2022 · 5 comments · Fixed by #50
Assignees
Labels
enhancement New feature or request

Comments

@sergiodxa
Copy link
Owner

The helper should receive a Request or Headers object and try to get the IP address from the following headers:

  1. X-Client-IP
  2. X-Forwarded-For
  3. CF-Connecting-IP
  4. Fastly-Client-Ip
  5. True-Client-Ip
  6. X-Real-IP
  7. X-Cluster-Client-IP
  8. X-Forwarded, Forwarded-For and Forwarded
@sergiodxa sergiodxa added the enhancement New feature or request label Mar 3, 2022
@sergiodxa sergiodxa self-assigned this Mar 3, 2022
@mcansh
Copy link
Contributor

mcansh commented Mar 3, 2022

Fly.io has fly-client-ip too 😬

https://fly.io/docs/reference/runtime-environment/#fly-client-ip

@sergiodxa
Copy link
Owner Author

@mcansh that's too new to be on the StackOverflow answer where I got the list of headers 😅

@sergiodxa
Copy link
Owner Author

@mcansh done #51, the nice thing is that adding new headers it's just adding to the list and that's all

@mcansh
Copy link
Contributor

mcansh commented Mar 3, 2022

the nice thing is that adding new headers it's just adding to the list and that's all

nice! I was going to make a PR after I finished some cli work :) - thanks!

@sergiodxa
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants