-
Notifications
You must be signed in to change notification settings - Fork 73
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
Conversation
Pull Request Test Coverage Report for Build 6858847444
💛 - Coveralls |
r? @cds2-stripe |
Pull Request Test Coverage Report for Build 6858934496
💛 - Coveralls |
373a392
to
3f8bcc3
Compare
Pull Request Test Coverage Report for Build 6859183623
💛 - Coveralls |
2f7264e
to
3f8bcc3
Compare
Pull Request Test Coverage Report for Build 6869798316
💛 - Coveralls |
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.
Just a couple of small variable changes!
cmd/smokescreen.go
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change this to:
Set Smokescreen's upstream HTTP proxy address
cmd/smokescreen.go
Outdated
cli.StringFlag{ | ||
Name: "transport-https-proxy-addr", | ||
Value: "", | ||
Usage: "Set the smokescreen's HTTPS transport proxy address", |
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.
Same as above but for HTTPS
cmd/smokescreen.go
Outdated
@@ -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", |
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
cmd/smokescreen.go
Outdated
Usage: "Set the smokescreen's HTTP transport proxy address", | ||
}, | ||
cli.StringFlag{ | ||
Name: "transport-https-proxy-addr", |
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.
upstream-https-proxy-addr
pkg/smokescreen/config.go
Outdated
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
UpstreamHttpProxyAddr string
UpstreamHttpsProxyAddr string
r? @cds2-stripe |
Summary
Update the stripe/goproxy dependency to include stripe/goproxy#22. Allow setting the httpProxyAddr and httpsProxyAddr directly in smokescreen's configuration. When the TransportHttpProxyAddr and TransportHttpsProxyAddr in the smokescreen configuration is non-empty, use these proxy address to create the
NewProxyHttpServer
for smokescreen. If these addresses are not set, use the default values from environment.Motivation
stripe/smokescreen uses this library for the proxy server. Currently, the only way to set the transport proxy for smokescreen are setting the proxy from environment, which requires us to set the environment variables like HTTP_PROXY, HTTPS_PROXY. We would like to have a more robust way of configuring the smokescreen server's transport proxy. Thus we are adding the transport proxy address as another configurations for the smokescreen server and the goproxy library it uses underneath.
Test plan