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

Add server bind option #190

Merged
merged 3 commits into from
Oct 27, 2020
Merged

Add server bind option #190

merged 3 commits into from
Oct 27, 2020

Conversation

op69qs
Copy link
Contributor

@op69qs op69qs commented Oct 22, 2020

Add Server.path and Server.bindAddress two options to special http server handle path and Bind Address.

op69qs and others added 2 commits October 20, 2020 17:51
Copy link
Owner

@mxpv mxpv left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! A few suggestions below.

srv.Addr = fmt.Sprintf(":%d", port)
log.Debugf("using address: %s", srv.Addr)
srv.Addr = fmt.Sprintf("%s:%d", bindAddress, port)
//srv.Addr = fmt.Sprintf("{{$bindAddress:$port}}")
Copy link
Owner

Choose a reason for hiding this comment

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

nit: remove this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK ,my bad miss that

# Bind a specific IP addresses for server ,"*": bind all IP addresses which is default option, localhost or 127.0.0.1 bind a single IPv4 address
bind_address = "172.20.10.2"
# Specify path for reverse proxy and only [A-Za-z0-9]
path = "test"
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please update the comment that this is related to URL path specifically? Possibly with en example.
(I was confused for a moment why we need both path and data_dir until I referred to Go's documentation).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

@mxpv mxpv merged commit 2751c4b into mxpv:master Oct 27, 2020
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.

2 participants