There this weird thing that keeps happening every few requests where Go's http
package throws the following error:
http2: server sent GOAWAY and closed the connection; LastStreamID=19999, ErrCode=NO_ERROR, debug=""
And so I realised that the default transport has ForceAttemptHTTP2
set to true
(https://golang.org/src/net/http/transport.go line 48), so I manually set that to false like below:
transport := &http.Transport{
ForceAttemptHTTP2: false,
}
httpClient := &http.Client{Transport: transport}
But even after doing that, I still get the same http2 error instead of http1, which is not making sense to me?
I'm new to networking so I have a feeling I'm missing something that should be obvious here?
I guess the question would be how do I force the http
package to only use http
and not http2