-
Notifications
You must be signed in to change notification settings - Fork 2
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
dont listen on all devices #2
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.
This change seems wrong to me. It makes this crate only useful for applications that only listen locally, which is—at least for me—a minority?
I'm wondering if the better thing to do is make this actually be a BindAddress
type that adds --port
and --address
flags.
I agree it is a better default, but also a pretty big blocker for production use, as @kamalmarhubi already mentioned. Can we simply add an "address" field of type SocketAddr? This is not optimal (because instead of rather typtical |
I've added a This is different from Usage would be: $ ./main --port 8080 --hostname 0.0.0.0
$ ./main --port 8080 -H 0.0.0.0
$ ./main --port 8080 # defaults to 127.0.0.1 Unresolved Questions
Other Changes
|
src/lib.rs
Outdated
@@ -41,7 +43,7 @@ pub struct Port { | |||
/// | |||
/// ## Panics | |||
/// If a file descriptor Was passed directly, we call the unsafe |
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.
s/Was/was
This PR is good. The following does not need to be addressed here but I'd like to see it addressed (implemented or dismissed) in a future PR though :)
|
24189b8
to
d2b3ddc
Compare
d2b3ddc
to
0af2ce2
Compare
Heh yeah I guess that's fair. But if you think of domain names as fancy aliases for IP addresses it probably makes more sense. It does adhere to the url spec, so we can outsource the weirdness 😛.
Oh yeah, good one!
Yeah, I agree that's important information - but typically this is information I'd like to see in a man page, and less so in the Right now I'm not sure how to hide information in doc comments from appearing in |
Implemented all feedback! 🎉 |
This is possibly too late, but re |
This makes it so we don't listen on all interfaces, which
prevents some security issues.
First reported here:
https://twitter.com/badboy_/status/1003266217803730945
Thanks!