mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-03 06:37:14 +01:00
Rename bindaddr to just bind
This commit is contained in:
parent
d3aedbeb9a
commit
46f7930787
3 changed files with 7 additions and 7 deletions
|
@ -43,7 +43,7 @@ var directiveOrder = []directive{
|
||||||
// Essential directives that initialize vital configuration settings
|
// Essential directives that initialize vital configuration settings
|
||||||
{"root", setup.Root},
|
{"root", setup.Root},
|
||||||
{"tls", setup.TLS},
|
{"tls", setup.TLS},
|
||||||
{"bindaddr", setup.BindAddr},
|
{"bind", setup.BindHost},
|
||||||
|
|
||||||
// Other directives that don't create HTTP handlers
|
// Other directives that don't create HTTP handlers
|
||||||
{"startup", setup.Startup},
|
{"startup", setup.Startup},
|
||||||
|
|
|
@ -2,9 +2,9 @@ package setup
|
||||||
|
|
||||||
import "github.com/mholt/caddy/middleware"
|
import "github.com/mholt/caddy/middleware"
|
||||||
|
|
||||||
func BindAddr(c *Controller) (middleware.Middleware, error) {
|
func BindHost(c *Controller) (middleware.Middleware, error) {
|
||||||
for c.Next() {
|
for c.Next() {
|
||||||
if !c.Args(&c.BindAddress) {
|
if !c.Args(&c.BindHost) {
|
||||||
return nil, c.ArgErr()
|
return nil, c.ArgErr()
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,8 +11,8 @@ type Config struct {
|
||||||
// The hostname or IP on which to serve
|
// The hostname or IP on which to serve
|
||||||
Host string
|
Host string
|
||||||
|
|
||||||
// The address to bind on - defaults to Host if empty
|
// The host address to bind on - defaults to (virtual) Host if empty
|
||||||
BindAddress string
|
BindHost string
|
||||||
|
|
||||||
// The port to listen on
|
// The port to listen on
|
||||||
Port string
|
Port string
|
||||||
|
@ -47,8 +47,8 @@ type Config struct {
|
||||||
|
|
||||||
// Address returns the host:port of c as a string.
|
// Address returns the host:port of c as a string.
|
||||||
func (c Config) Address() string {
|
func (c Config) Address() string {
|
||||||
if c.BindAddress != "" {
|
if c.BindHost != "" {
|
||||||
return net.JoinHostPort(c.BindAddress, c.Port)
|
return net.JoinHostPort(c.BindHost, c.Port)
|
||||||
}
|
}
|
||||||
return net.JoinHostPort(c.Host, c.Port)
|
return net.JoinHostPort(c.Host, c.Port)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue