The request load balancing of golang HTTP1.1 is forwarded according to http2.0

Time:2021-9-19

Key parameters:
TLSNextProto

Solution:
Setting tlsnextproto to an empty map will not automatically upgrade, which is equivalent to turning off http2.0

client := &http.Client {
  Transport:&http.Transport{
      TLSNextProto: map[string]func(authority string, c *tls.Conn) http.RoundTripper{},
  },
}

reason:
come from https://stackoverflow.com/que…
Starting with Go 1.6, the http package has transparent support for the HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 can do so by setting Transport.TLSNextProto (for clients) or Server.TLSNextProto (for servers) to a non-nil, empty map. Alternatively, the following GODEBUG environment variables are currently supported:

Recommended Today

STM32 IIC details

1. IIC definition IIC is inter integrated circuit bus. This bus type is a simple, bidirectional, two-wire and synchronous serial bus designed by Philips semiconductor company (later acquired by NXP) in the early 1980s. It is mainly used to connect the overall circuit (ICS) , IIC is a multi-directional control bus, that is, multiple chips […]