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

Expose local_addr information from TcpStream #2767

Closed
kubuzetto opened this issue Feb 26, 2022 · 0 comments
Closed

Expose local_addr information from TcpStream #2767

kubuzetto opened this issue Feb 26, 2022 · 0 comments
Labels
C-feature Category: feature. This is adding a new feature.

Comments

@kubuzetto
Copy link
Contributor

Currently, the HttpInfo expansion struct only exposes the remote_addr information from the underlying TcpStream. It would be desirable to also access the local_addr.

Since the client chooses a random* port from the ephemeral range for the local address; and the IP address might also be picked at random on devices with multiple NICs; the only reliable method of finding out the local address of an HTTP request would be to retrieve it from the TcpStream. Since hyper does not propagate the value to the response; the information is unavailable to those who need it.

Since TcpStream already contains this information, all we need to do is to add a field in the HttpInfo struct and assigning it.

@kubuzetto kubuzetto added the C-feature Category: feature. This is adding a new feature. label Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant