update help
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
@@ -34,7 +35,7 @@ func NewConfig() (Config, error) {
|
||||
fs.StringVar(&c.Cert.CRT, "crt", "", "path to .crt")
|
||||
fs.StringVar(&c.Cert.Key, "key", "", "path to .key")
|
||||
fs.IntVar(&c.Port, "p", 56112, "port to listen on")
|
||||
f := fs.String("f", "/dev/null", `file of {domains:{.com:{google:{to: scheme://host:port, basicAuth: u:p, redir: false}}}}`)
|
||||
f := fs.String("f", "/dev/null", `file of {domains:{com:{google:{to: scheme://host:port, basicAuth: u:p, redir: false}}}}`)
|
||||
if err := fs.Parse(os.Args[1:]); err != nil {
|
||||
return c, err
|
||||
}
|
||||
@@ -47,5 +48,13 @@ func NewConfig() (Config, error) {
|
||||
return c, fmt.Errorf("no domains configured")
|
||||
}
|
||||
|
||||
keys := []string{}
|
||||
for k, v := range c.Domains {
|
||||
for k2 := range v {
|
||||
keys = append(keys, fmt.Sprintf("%s.%s", k2, k))
|
||||
}
|
||||
}
|
||||
log.Printf("redirecting %+v", keys)
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user