How to disable HTTP/2 for debugging bad behavior

2,197 views
Skip to first unread message

j...@nella.org

unread,
Dec 15, 2015, 9:42:48 AM12/15/15
to golang-dev
Hello Brad (and other interested h2 hackers),

I see that it is currently possible to turn off HTTP/2 via "GODEBUG=h2client=0".

Before I figured that out, I found I coud turn it off like this:

func init() {
// Disable HTTP/2
http.DefaultClient.Transport = &http.Transport{
TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper),
}
}

What is the plan for making this easier to do and to find out about?

I have unfortunately already found a site where h2 makes things start failing in a mysterious way, and the process of figuring this out was very long and frustrating.

  -jeff

j...@nella.org

unread,
Dec 15, 2015, 10:48:56 AM12/15/15
to golang-dev, j...@nella.org
Oh, I just found https://github.com/golang/go/issues/13611 which is a reminder to document this better.

Thanks,
  -jeff

Brad Fitzpatrick

unread,
Dec 15, 2015, 11:09:44 AM12/15/15
to Jeff R. Allen, golang-dev
If you found a case where h2 doesn't work, the correct course of action is to file a bug about fixing h2 with the repro steps you found, NOT to file bugs about making it easier to document how to disable it.

(The release notes say how to disable it already, and the bug you later found.)

But please bugs.


--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages