Skip to content

Commit

Permalink
bind: HTTPServerConfig, change addr to address for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Oct 14, 2022
1 parent 35512ba commit fd6ef0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bind/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func HTTPServerConfig(fs *pflag.FlagSet, cfg *forwarder.HTTPServerConfig, prefix
anyflag.EnumParser[forwarder.Scheme](forwarder.HTTPScheme, forwarder.HTTPSScheme, forwarder.HTTP2Scheme)),
namePrefix+"protocol", "", usagePrefix+"HTTP server protocol, one of http, https, h2")
fs.StringVarP(&cfg.Addr,
namePrefix+"addr", "", cfg.Addr, usagePrefix+"HTTP server listen address")
namePrefix+"address", "", cfg.Addr, usagePrefix+"HTTP server listen address in the form of `host:port`")
fs.StringVar(&cfg.CertFile,
namePrefix+"cert-file", cfg.CertFile, usagePrefix+"HTTP server TLS certificate file")
fs.StringVar(&cfg.KeyFile,
Expand Down
14 changes: 7 additions & 7 deletions cmd/forwarder/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ It supports custom DNS servers.
`

const example = `Start HTTP proxy listening to localhost:8080:
$ forwarder proxy --addr localhost:8080
$ forwarder proxy --address localhost:8080
Start a protected proxy protected with basic auth:
$ forwarder proxy --addr localhost:8080 --basic-auth user:pass
$ forwarder proxy --address localhost:8080 --basic-auth user:pass
Forward connections to an upstream proxy:
$ forwarder proxy --addr localhost:8080 --upstream-proxy-uri http://localhost:8089
$ forwarder proxy --address localhost:8080 --upstream-proxy-uri http://localhost:8089
Forward connections to an upstream proxy protected with basic auth:
$ forwarder proxy --addr localhost:8080 --upstream-proxy-uri http://localhost:8089 --upstream-proxy-basic-auth user:pass
$ forwarder proxy --address localhost:8080 --upstream-proxy-uri http://localhost:8089 --upstream-proxy-basic-auth user:pass
Forward connections to an upstream proxy setup via PAC:
$ forwarder proxy --addr localhost:8080 --pac-uri http://localhost:8090/pac
$ forwarder proxy --address localhost:8080 --pac-uri http://localhost:8090/pac
Forward connections to an upstream proxy, setup via PAC protected with basic auth:
$ forwarder proxy --addr localhost:8080 --pac-uri http://user:pass@localhost:8090/pac -d http://user3:pwd4@localhost:8091 -d http://user2:pwd2@localhost:8092
$ forwarder proxy --address localhost:8080 --pac-uri http://user:pass@localhost:8090/pac -d http://user3:pwd4@localhost:8091 -d http://user2:pwd2@localhost:8092
Add basic auth header to requests to foo.bar:* and qux.baz:80.
$ forwarder proxy --addr localhost:8080 --site-credentials "foo.bar:0,qux.baz:80"
$ forwarder proxy --address localhost:8080 --site-credentials "foo.bar:0,qux.baz:80"
`

func Command() (cmd *cobra.Command) {
Expand Down

0 comments on commit fd6ef0e

Please sign in to comment.