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

Use go-sockaddr to parse address strings #653

Merged
merged 1 commit into from
May 6, 2019

Conversation

aaronhurt
Copy link
Member

Use go-sockaddr to parse proxy listeners, consul service address and the proxy local ip to allow more dynamic configuration of address strings.

@aaronhurt
Copy link
Member Author

This should allow more dynamic configuration of listeners and advertised addresses when running within a container environment.

Basic Example:

./fabio -proxy.addr '{{ GetInterfaceIP "en0" }}:4567' \
-ui.addr '{{ GetInterfaceIP "en0" }}:1234' \
-registry.consul.register.addr '{{ GetInterfaceIP "en0" }}:1234'

Renders:

2019/04/30 17:52:10 [INFO] Admin server listening on "10.16.0.29:1234"
2019/04/30 17:52:10 [INFO] Waiting for first routing table
2019/04/30 17:52:10 [INFO] consul: Using dynamic routes
2019/04/30 17:52:10 [INFO] consul: Using tag prefix "urlprefix-"
2019/04/30 17:52:10 [INFO] consul: Watching KV path "/fabio/config"
2019/04/30 17:52:10 [INFO] consul: Watching KV path "/fabio/noroute.html"
2019/04/30 17:52:10 [INFO] consul: Registered fabio as "fabio"
2019/04/30 17:52:10 [INFO] consul: Registered fabio with id "fabio-ahurt1.local-1234"
2019/04/30 17:52:10 [INFO] consul: Registered fabio with address "10.16.0.29"
2019/04/30 17:52:10 [INFO] consul: Registered fabio with tags ""
2019/04/30 17:52:10 [INFO] consul: Registered fabio with health check to "http://[10.16.0.29]:1234/health"
2019/04/30 17:52:10 [INFO] HTTP proxy listening on 10.16.0.29:4567

Copy link
Member

@pschultz pschultz left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@aaronhurt aaronhurt merged commit 2982f38 into fabiolb:master May 6, 2019
@aaronhurt
Copy link
Member Author

Thank you!

@magiconair magiconair added this to the 1.5.12 milestone Oct 11, 2019
@aaronhurt aaronhurt deleted the issue-652-dynamic-registration branch January 22, 2020 22:29
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.

None yet

3 participants