-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore: resolve external IP with just an http request #8516
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine with removing igd-next, don't think this is actually useful.
I also, don't think we really need DNS queries
crates/net/nat/src/lib.rs
Outdated
let response = reqwest::get("http://ipinfo.io/ip").await.ok()?; | ||
let response = response.error_for_status().ok()?; | ||
let text = response.text().await.ok()?; | ||
text.trim().parse().ok() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public_ip::addr does a bit more than that, for example DNS queries
but we can add support natively I think, and this should be sufficient
but can we do "http://bot.whatismyipaddress.com"
as well? then we're on par with public_ip for the HTTP part at least
turns out this API was shut down:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public_ip::addr does a bit more than that, for example DNS queries
yes would be nice if it was maintained tho :D
3379521
to
05ead79
Compare
Removes two dependencies used solely for getting the external IP:
which will be duplicating old versions of reqwest, hyper and http after #7018