Skip to content

Commit

Permalink
variable name change
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuxi-stripe committed Nov 14, 2023
1 parent 413045a commit 892f9cb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions cmd/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ func startSmokescreen(t *testing.T, useTLS bool, logHook logrus.Hook, httpProxyA
}

if httpProxyAddr != ""{
args = append(args, fmt.Sprintf("--transport-http-proxy-addr=%s", httpProxyAddr))
args = append(args, fmt.Sprintf("--transport-https-proxy-addr=%s", httpProxyAddr))
args = append(args, fmt.Sprintf("--upstream-http-proxy-addr=%s", httpProxyAddr))
args = append(args, fmt.Sprintf("--upstream-https-proxy-addr=%s", httpProxyAddr))
}

conf, err := NewConfiguration(args, nil)
Expand Down
16 changes: 8 additions & 8 deletions cmd/smokescreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ func NewConfiguration(args []string, logger *log.Logger) (*smokescreen.Config, e
Usage: "Allow private ip ranges by default",
},
cli.StringFlag{
Name: "transport-http-proxy-addr",
Name: "upstream-http-proxy-addr",
Value: "",
Usage: "Set the smokescreen's HTTP transport proxy address",
Usage: "Set Smokescreen's upstream HTTP proxy address",
},
cli.StringFlag{
Name: "transport-https-proxy-addr",
Name: "upstream-https-proxy-addr",
Value: "",
Usage: "Set the smokescreen's HTTPS transport proxy address",
Usage: "Set Smokescreen's upstream HTTPS proxy address",
},
}

Expand Down Expand Up @@ -297,12 +297,12 @@ 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("upstream-http-proxy-addr") {
conf.UpstreamHttpProxyAddr = c.String("upstream-http-proxy-addr")
}

if c.IsSet("transport-https-proxy-addr") {
conf.TransportHttpsProxyAddr = c.String("transport-https-proxy-addr")
if c.IsSet("upstream-https-proxy-addr") {
conf.UpstreamHttpsProxyAddr = c.String("upstream-https-proxy-addr")
}

// Setup the connection tracker if there is not yet one in the config
Expand Down
6 changes: 3 additions & 3 deletions pkg/smokescreen/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ type Config struct {
TransportMaxIdleConns int
TransportMaxIdleConnsPerHost int

// There are the http and https address for the transport proxy
TransportHttpProxyAddr string
TransportHttpsProxyAddr string
// These are the http and https address for the upstream proxy
UpstreamHttpProxyAddr string
UpstreamHttpsProxyAddr string

// Used for logging connection time
TimeConnect bool
Expand Down
2 changes: 1 addition & 1 deletion pkg/smokescreen/smokescreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func newContext(cfg *Config, proxyType string, req *http.Request) *SmokescreenCo
}

func BuildProxy(config *Config) *goproxy.ProxyHttpServer {
proxy := goproxy.NewProxyHttpServer(goproxy.WithHttpProxyAddr(config.TransportHttpProxyAddr), goproxy.WithHttpsProxyAddr(config.TransportHttpsProxyAddr))
proxy := goproxy.NewProxyHttpServer(goproxy.WithHttpProxyAddr(config.UpstreamHttpProxyAddr), goproxy.WithHttpsProxyAddr(config.UpstreamHttpsProxyAddr))
proxy.Verbose = false
configureTransport(proxy.Tr, config)

Expand Down

0 comments on commit 892f9cb

Please sign in to comment.