Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caddy
Commits
46f79307
Commit
46f79307
authored
May 04, 2015
by
Nimi Wariboko Jr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename bindaddr to just bind
parent
d3aedbeb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
config/directives.go
config/directives.go
+1
-1
config/setup/bindhost.go
config/setup/bindhost.go
+2
-2
server/config.go
server/config.go
+4
-4
No files found.
config/directives.go
View file @
46f79307
...
@@ -43,7 +43,7 @@ var directiveOrder = []directive{
...
@@ -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
},
{
"bind
addr"
,
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
},
...
...
config/setup/bind
addr
.go
→
config/setup/bind
host
.go
View file @
46f79307
...
@@ -2,9 +2,9 @@ package setup
...
@@ -2,9 +2,9 @@ package setup
import
"github.com/mholt/caddy/middleware"
import
"github.com/mholt/caddy/middleware"
func
Bind
Addr
(
c
*
Controller
)
(
middleware
.
Middleware
,
error
)
{
func
Bind
Host
(
c
*
Controller
)
(
middleware
.
Middleware
,
error
)
{
for
c
.
Next
()
{
for
c
.
Next
()
{
if
!
c
.
Args
(
&
c
.
Bind
Address
)
{
if
!
c
.
Args
(
&
c
.
Bind
Host
)
{
return
nil
,
c
.
ArgErr
()
return
nil
,
c
.
ArgErr
()
}
}
}
}
...
...
server/config.go
View file @
46f79307
...
@@ -11,8 +11,8 @@ type Config struct {
...
@@ -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
Bind
Address
string
Bind
Host
string
// The port to listen on
// The port to listen on
Port
string
Port
string
...
@@ -47,8 +47,8 @@ type Config struct {
...
@@ -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
.
Bind
Address
!=
""
{
if
c
.
Bind
Host
!=
""
{
return
net
.
JoinHostPort
(
c
.
Bind
Address
,
c
.
Port
)
return
net
.
JoinHostPort
(
c
.
Bind
Host
,
c
.
Port
)
}
}
return
net
.
JoinHostPort
(
c
.
Host
,
c
.
Port
)
return
net
.
JoinHostPort
(
c
.
Host
,
c
.
Port
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment