Golang: http2 client immediately close connections via proxy while idleConn was enabled

843 views
Skip to first unread message

zzk code

unread,
Dec 5, 2021, 10:37:31 PM12/5/21
to golang-nuts

I'm using Go to implement an http client and squid as a forward proxy to send requests to remote servers. Things goes well when using http/1.1 via proxy or http/1.1, http2 without proxy, however, while using http2 client via proxy, most of the connections were closed immediately and only one or two were kept.

Not sure it's my bad code or what. The idleConn configuration was enabled on the http transport. Thanks in advance.

Since there are many code blocks, I post a question including details on StackOverflow. Is there anyone who could give some suggestions that what should I do to figure it out? Thanks.

go - Golang: http2 client immediately close connections via proxy while idleConn was enabled - Stack Overflow

zzk code

unread,
Dec 6, 2021, 11:54:13 PM12/6/21
to golang-nuts

Jérôme LAFORGE

unread,
Dec 7, 2021, 5:33:34 AM12/7/21
to golang-nuts
nice issue number :)

zzk code

unread,
Dec 12, 2021, 3:23:51 AM12/12/21
to golang-nuts
Finally, I figure it out and everything is working as expected, so it's nothing to do with net/http2.

For more details, please refer to this issue: https://github.com/golang/go/issues/50000. And it's a nice issue number indeed :>.
Reply all
Reply to author
Forward
0 new messages