Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-and-push-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
## Pushes to PKB private repository, change the registry if you want to push it elsewhere

## Increment this number when you push a new image
VERSION=8
VERSION=9-MFATEST
docker build . -t "europe-docker.pkg.dev/infra-240614/eu.gcr.io/regproxy2:$VERSION"
docker push "europe-docker.pkg.dev/infra-240614/eu.gcr.io/regproxy2:$VERSION"
19 changes: 11 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,13 @@ func NewRegProxy(
}
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: dc,
MaxIdleConns: int(*clientMaxIdleConnections),
IdleConnTimeout: *clientMaxIdleTimeout,
Proxy: http.ProxyFromEnvironment,
DialContext: dc,
ForceAttemptHTTP2: false,
MaxIdleConns: int(*clientMaxIdleConnections),
IdleConnTimeout: *clientMaxIdleTimeout,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
Comment on lines +340 to +341
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these configurable as command line arguments (like the others), so that we can tune this without releasing a new version of regproxy?

Copy link
Copy Markdown
Contributor Author

@MFAshby MFAshby Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied and pasted these from the default configuration and possible I shouldn't have...

Both are irrelevant for our use case (test-control doesn't use TLS, nor does it use HTTP 100-continue responses.)

I could make them configurable for the convenience of others who might be using these features but it won't help us.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining. Approved.

},
Timeout: *clientHttpTimeout,
}
Expand All @@ -359,10 +362,10 @@ func main() {
serverReadTimeout := flag.Duration("server-read-timeout", 1*time.Second, "server read timeout")
serverWriteTimeout := flag.Duration("server-write-timeout", 40*time.Second, "server write timeout")
clientHttpTimeout := flag.Duration("client-http-timeout", 40*time.Second, "client timeout (for upstreams)")
clientDialTimeout := flag.Duration("client-dial-timeout", 1*time.Second, "client dialer timeout")
clientKeepAliveInterval := flag.Duration("client-keep-alive-interval", -1*time.Second, "client keep-alive interval")
clientMaxIdleConnections := flag.Int64("client-max-idle-conns", 1, "client max idle connections (for connection pooling)")
clientMaxIdleTimeout := flag.Duration("client-max-idle-timeout", 1*time.Second, "client idle connection timeout (for connection pooling)")
clientDialTimeout := flag.Duration("client-dial-timeout", 30*time.Second, "client dialer timeout")
clientKeepAliveInterval := flag.Duration("client-keep-alive-interval", 30*time.Second, "client keep-alive interval")
clientMaxIdleConnections := flag.Int64("client-max-idle-conns", 100, "client max idle connections (for connection pooling)")
clientMaxIdleTimeout := flag.Duration("client-max-idle-timeout", 90*time.Second, "client idle connection timeout (for connection pooling)")
useDnsCachePtr := flag.Bool("use-dns-cache", true, "use an internal DNS cache")
dnsCacheRefresh := flag.Duration("dns-cache-refresh", 100*time.Hour, "interval for refrshing DNS cache")
dnsLookupTimeout := flag.Duration("dns-lookup-timeout", 5*time.Second, "timeout for DNS lookups")
Expand Down