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 remote_addr field to Request #6

Closed
wants to merge 1 commit into from

Conversation

CuriouslyCurious
Copy link
Contributor

@CuriouslyCurious CuriouslyCurious commented Feb 28, 2021

Wanted to retrieve the IP addresses from the remote hosts that connect to the server, so added a simple implementation for getting the underlying stream.peer_addr() to the Request struct.

One thing I considered is if this should be done at the HTTP-level but since there is no guarantee that the remote host's IP is included in the headers I did this instead. Also debated whether or not it should use SocketStream instead of just String, but this is the simplest solution for now.

Love the project's philosophy, btw! <3

@CuriouslyCurious
Copy link
Contributor Author

Hiya!

This project still kicking?

@sigaloid sigaloid mentioned this pull request Oct 23, 2021
@sigaloid sigaloid mentioned this pull request Jan 8, 2022
@xvxx
Copy link
Owner

xvxx commented Nov 16, 2022

This should now be in the main development branch. I pulled in @sigaloid's version that uses the SocketAddr instead of a String - hope that works for you! Thank you!

@xvxx xvxx closed this Nov 16, 2022
@CuriouslyCurious CuriouslyCurious deleted the remote_addr branch November 16, 2022 09:28
@CuriouslyCurious
Copy link
Contributor Author

Glad to see you are back!

It is a fine solution. <3

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

Successfully merging this pull request may close these issues.

2 participants