-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable http and https proxy addrs #208
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,11 +94,11 @@ func NewConfiguration(args []string, logger *log.Logger) (*smokescreen.Config, e | |
Value: "/metrics", | ||
Usage: "Expose prometheus metrics on `ENDPOINT`. Requires --expose-prometheus-metrics to be set. Defaults to \"/metrics\"", | ||
}, | ||
cli.StringFlag{ | ||
Name: "prometheus-listen-ip", | ||
Value: "0.0.0.0", | ||
Usage: "Listen for prometheus metrics on interface with address IP. Requires --expose-prometheus-metrics to be set. Defaults to \"0.0.0.0\"", | ||
}, | ||
cli.StringFlag{ | ||
Name: "prometheus-listen-ip", | ||
Value: "0.0.0.0", | ||
Usage: "Listen for prometheus metrics on interface with address IP. Requires --expose-prometheus-metrics to be set. Defaults to \"0.0.0.0\"", | ||
}, | ||
cli.StringFlag{ | ||
Name: "prometheus-port", | ||
Value: "9810", | ||
|
@@ -146,6 +146,16 @@ func NewConfiguration(args []string, logger *log.Logger) (*smokescreen.Config, e | |
Name: "unsafe-allow-private-ranges", | ||
Usage: "Allow private ip ranges by default", | ||
}, | ||
cli.StringFlag{ | ||
Name: "transport-http-proxy-addr", | ||
Value: "", | ||
Usage: "Set the smokescreen's HTTP transport proxy address", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we change this to:
|
||
}, | ||
cli.StringFlag{ | ||
Name: "transport-https-proxy-addr", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Value: "", | ||
Usage: "Set the smokescreen's HTTPS transport proxy address", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above but for HTTPS |
||
}, | ||
} | ||
|
||
app.Action = func(c *cli.Context) error { | ||
|
@@ -287,6 +297,14 @@ func NewConfiguration(args []string, logger *log.Logger) (*smokescreen.Config, e | |
} | ||
} | ||
|
||
if c.IsSet("transport-http-proxy-addr") { | ||
conf.TransportHttpProxyAddr = c.String("transport-http-proxy-addr") | ||
} | ||
|
||
if c.IsSet("transport-https-proxy-addr") { | ||
conf.TransportHttpsProxyAddr = c.String("transport-https-proxy-addr") | ||
} | ||
|
||
// Setup the connection tracker if there is not yet one in the config | ||
if conf.ConnTracker == nil { | ||
conf.ConnTracker = conntrack.NewTracker(conf.IdleTimeout, conf.MetricsClient, conf.Log, conf.ShuttingDown, nil) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,10 @@ type Config struct { | |
TransportMaxIdleConns int | ||
TransportMaxIdleConnsPerHost int | ||
|
||
// There are the http and https address for the transport proxy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
TransportHttpProxyAddr string | ||
TransportHttpsProxyAddr string | ||
|
||
// Used for logging connection time | ||
TimeConnect bool | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change this to:
upstream-http-proxy-addr