hyperium / hyper

An HTTP library for Rust
https://hyper.rs
MIT License
14.58k stars 1.6k forks source link

how to get client IP address in 1.0? #3310

Closed seeekr closed 1 year ago

seeekr commented 1 year ago

Hey, first off thanks for your amazing work on hyper! I was wondering how to get the client IP address now in v1.0 RC, as the old way of doing it doesn't work any more and I can't seem to find a new way. Help super appreciated! Thanks!

EDIT: To clarify, this is when accepting requests with an http server (http1 in my current case). EDIT2: This is how this could be accomplished in hyper 0.14: https://github.com/hyperium/hyper/issues/1758

seeekr commented 1 year ago

Never mind, I... may have goofed. Sorry for making this issue :D Again thanks for the great work!

(For the internet being as silly as I am: Well, in hyper 1.0 you're handling the client socket yourself, so nothing that hyper needs to do to give you the client's address!)