Skip to content
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

HTTPS proxy hangs during stress test #481

Open
sausagenoods opened this issue Jul 22, 2022 · 0 comments
Open

HTTPS proxy hangs during stress test #481

sausagenoods opened this issue Jul 22, 2022 · 0 comments

Comments

@sausagenoods
Copy link

sausagenoods commented Jul 22, 2022

Hello, I implemented a forward HTTPS proxy using this library. When I test using ab-proxy, it always hangs during the test. Here is the relevant section of the code:

func main() {
        loadConfig()
        authCache, _ = bigcache.NewBigCache(bigcache.DefaultConfig(c.credCacheTTL))
        proxy := goproxy.NewProxyHttpServer()
        proxy.Tr.MaxIdleConns = 0
        proxy.Tr.MaxConnsPerHost = 0
        proxy.Tr.MaxIdleConnsPerHost = 0
        proxy.Verbose = c.verbose
        s := &http.Server{
                Addr: c.bindAddr,
                Handler: proxy,
                TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),
        }
        log.Fatal(s.ListenAndServeTLS(c.certFile, c.keyFile))
}

Here is the command I'm using to test:
./ab-proxy -c 20 -n 5000 --proxy 'https://user:[email protected]' 'https://syd1.speedtest.telstra.net:8080/download?size=10485760'
It makes 5000 GET requests to download 10 MiB from a server using 20 threads through the proxy server.

When I import a fork of this library instead without changing anything in the code, it no longer hangs and works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant