Add proxy flag for alternative proxy configuration

Bel LaPointe 2020-02-19 14:43:44 -07:00
parent ba322e596e
commit bc11bcf41a
1 changed files with 4 additions and 0 deletions

View File

@ -15,9 +15,13 @@ func New() error {
as.Append(args.STRING, "port", "port to listen on", "33419")
as.Append(args.STRING, "db", "database type code", storage.MAP.String())
as.Append(args.STRING, "ns", "namespace", storage.DefaultNamespace)
as.Append(args.STRING, "proxy", "http proxy", "")
if err := as.Parse(); err != nil {
return err
}
if proxy := as.Get("proxy").GetString(); len(proxy) > 0 {
os.Setenv("http_proxy", proxy)
}
ctx, can := context.WithCancel(context.Background())
config = Config{
db: as.Get("db").GetString(),