Skip to content

Commit

Permalink
Updating instructions for new address flag behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Sergeyev committed Feb 14, 2014
1 parent d888f8d commit 889135a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
)

type Config struct {
BasePath string // Base URL path. e.g. "/"
Addr []string // TCP address to listen on. e.g. ":1234", "1.2.3.4:1234"
BasePath string // Base URL path. e.g. "/"
Addr []string // TCP addresses to listen on. e.g. ":1234", "1.2.3.4:1234" or "[::1]:1234"
LogLevel libwebsocketd.LogLevel
*libwebsocketd.Config
}
Expand All @@ -32,7 +32,7 @@ func parseCommandLine() Config {

// server config options
portFlag := flag.Int("port", 80, "HTTP port to listen on")
addressFlag := flag.String("address", "0.0.0.0", "Interface to bind to (e.g. 127.0.0.1)")
addressFlag := flag.String("address", "", "Interfaces to bind to separated by comma (e.g. 127.0.0.1). Empty means all.")
versionFlag := flag.Bool("version", false, "Print version and exit")
licenseFlag := flag.Bool("license", false, "Print license and exit")
logLevelFlag := flag.String("loglevel", "access", "Log level, one of: debug, trace, access, info, error, fatal")
Expand All @@ -49,7 +49,7 @@ func parseCommandLine() Config {

addrFields := strings.Split(*addressFlag, ",")
mainConfig.Addr = make([]string, len(addrFields))
for i,addrSingle := range addrFields {
for i, addrSingle := range addrFields {
mainConfig.Addr[i] = fmt.Sprintf("%s:%d", addrSingle, *portFlag)
}
mainConfig.BasePath = *basePathFlag
Expand Down
5 changes: 3 additions & 2 deletions help.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ Options:
--port=PORT HTTP port to listen on.
--address=ADDRESS Address to bind to.
Default: 0.0.0.0 (all)
--address=ADDRESS,ADDRESS Addresses to bind to (list separated by commas)
Use square brackets to specify IPv6 address.
Default: "" (all)
--basepath=PATH Base path in URLs to serve from.
Default: / (root of domain)
Expand Down

0 comments on commit 889135a

Please sign in to comment.