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

net.Listener() listens on all interfaces when no address is provided. #9

Closed
jeffreydwalter opened this issue Apr 14, 2017 · 3 comments

Comments

@jeffreydwalter
Copy link

Hey guys,
I don't use your project, but came across your commit here: ae2800d

Based on the comments in this commit, I'm lead to believe that the intent is to only listen on the loopback address(es) when only the port is specified.

If that is the intent, then that code is broken. If not, then ignore me. :)

Here's the relevant net.Listen() example from the golang docs: https://golang.org/pkg/net/#example_Listener

Happy trails!

@wincent
Copy link
Owner

wincent commented Apr 14, 2017

Well, that's a bummer. Guess I shouldn't have relied on that comment. (Just verified that what you say is true.) Will roll out a fix.

wincent added a commit that referenced this issue Apr 15, 2017
This is the dumb fix for the face-palm bug reported here:

  #9

wherein our attempt to listening on IPv4 and IPv6 loopback interfaces
when available was actually causing us to listen on all interfaces
(ugh).

I'll remove the duplication in the next commit, and also try to
gracefully handle systems which might not have IPv6 interfaces up.
@wincent
Copy link
Owner

wincent commented Apr 15, 2017

Thanks for the report. Just published 0.4.2 that fixes this.

@wincent wincent closed this as completed Apr 15, 2017
@jeffreydwalter
Copy link
Author

Happy to help! Since I was here, I took the liberty of looking over your commit, looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants