diff --git a/conf.yaml b/conf.yaml index aeedd08..993a2cb 100755 --- a/conf.yaml +++ b/conf.yaml @@ -1,11 +1,11 @@ -p: 54243 -r: -- echo:http://localhost:49982 -- echo2:http://192.168.0.86:38090 -#crt: ./testdata/rproxy3server.crt -#key: ./testdata/rproxy3server.key -#user: bel -#pass: bel -rate: 1 -burst: 2 -timeout: 10 +user: "" +pass: "" +port: 51555 +r: 100 +b: 100 +crt: "" +key: "" +tcp: "" +timeout: 1m +proxy: a,http://localhost:41912,,b,http://localhost:41912 +oauth: http://localhost:23456 diff --git a/config/new.go b/config/new.go index 892cb2c..2ce3749 100644 --- a/config/new.go +++ b/config/new.go @@ -30,7 +30,11 @@ func Refresh() error { } func parseArgs() (*args.ArgSet, error) { - as := args.NewArgSet() + configFiles := []string{} + if v, ok := os.LookupEnv("CONFIG"); ok { + configFiles = strings.Split(v, ",") + } + as := args.NewArgSet(configFiles...) as.Append(args.STRING, "user", "username for basic auth", "") as.Append(args.STRING, "pass", "password for basic auth", "")