-
Notifications
You must be signed in to change notification settings - Fork 98
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
Directly bind to interface name on supported platforms #359
Conversation
84e7852
to
e25815b
Compare
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.
xh --interface=lo example.org
now hangs forever. (It used to give a connect error.) Any idea?
(EDIT: it does give a timeout eventually.)
I'm not really sure. But if cURL is behaving the same, then it should be okay? $ curl http://example.org/ --interface lo
curl: (28) Failed to connect to example.org port 80 after 131767 ms: Connection timed out |
c5c281a
to
e9f62da
Compare
Another difference is that my (disconnected) ethernet interfaces now also hang forever while the old implementation gave a "Couldn't bind" error (because The crux seems to be that reqwest uses But yeah, it matches curl, good point. So it's probably for the best. |
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.
Looks good! We'll have to watch out for other platforms getting supported.
The latest release of reqwest (v0.12) has added
ClientBuilder::interface()
which removes the need for translating interface names to IP addresses before binding to them.However, this is only supported on limited platforms i.e linux, android and fuchsia so we still can't remove the
network-interface
crate/feature.Depends on #357