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

switch listener to tcp4 #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

switch listener to tcp4 #42

wants to merge 1 commit into from

Conversation

zot42
Copy link

@zot42 zot42 commented Oct 31, 2017

So as built the listener only listened on ipv6. I am running this as a mesos job and needed to have it listen on a ipv4 interface.

@nwhobart
Copy link

nwhobart commented Nov 1, 2017

LGTM! 🚢

Copy link
Collaborator

@JensRantil JensRantil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, but doesn't this remove support for TCP6? Have you tried doing -listen 1.2.3.6:7979 instead? That should make it listen to TCP4, no?

@zot42
Copy link
Author

zot42 commented Nov 14, 2017 via email

@@ -81,7 +82,11 @@ func main() {
)
prometheus.DefaultRegisterer.MustRegister(collector)

log.Fatal(http.ListenAndServe(c.String("listen"), promhttp.Handler()))
l, err := net.Listen("tcp4", c.String("listen"))
Copy link
Collaborator

@JensRantil JensRantil Nov 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making the first parameter to net.Listen(...) a flag, too? That would allow someone to use this application with IPv6 if they'd like to.

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

Successfully merging this pull request may close these issues.

4 participants