我有一个使用Golang构建的网关API。我们使用此处记录的“ net/http”库。该服务具有HTTPS连接设置。与我的ELB使用HTTP的连接是因为我使用TLS终止。因此,这个One Gateway API具有SSL证书。但是然后将连接传递到常规HTTP连接到其他实例。
简而言之,网关API具有HTTPS支持,但是连接到我的网关API的服务使用HTTP。
当我检查UI服务时,它表明我们仍在使用HTTP 1.1。但是,从Golang的文档中,软件包“ NET/HTTP”应自动提供HTTP 2.0支持。
我是否需要升级内部服务以使用HTTP而不是HTTP才能使用HTTP 2.0?
抱歉,如果这篇文章脱颖而出或粗鲁。我非常感谢任何人花时间阅读此书,并愿意提供更多所需的信息。
I have a Gateway API that is built with Golang. We use the "net/http" library documented here https://pkg.go.dev/net/http#example-ListenAndServeTLS. This service has HTTPS connection set up. The connections to my ELB’s use HTTPS because I use TLS termination. So this one Gateway API has the ssl cert. But then passes the connection to a regular HTTP connection to the other instances.
In short, the Gateway API has HTTPs support, but the services connected to my Gateway API uses HTTP.
When I check my UI services, It shows that we are using HTTP 1.1 still. However from Golang's documentation the package "net/http" should provide HTTP 2.0 support automatically.
Do I need to upgrade my internal services to use HTTPs instead of HTTP in order to use http 2.0?
Sorry If this post comes off as ignorant or rude. I really appreciate anyone taking there time to read this, and am willing to provide any more information that Is needed.
发布评论
评论(1)
HTTP2包括H2(TLS)H2C(无TLS),NET/HTTP使用H2默认值
listeandservetls
。如果使用http,则NET/http不使用H2C,而是http1.1
exase net/http不支持H2C默认值,如果您想使用H2C(http/2的非TLS版本):
http2 include h2(TLS) h2c(no TLS), net/http use h2 default when
ListenAndServeTLS
.if you use http, net/http not use h2c, but http1.1 currently no browser supports HTTP/2 unencrypted
becase net/http don't support h2c default, if you want use h2c(non-TLS version of HTTP/2):
https://pkg.go.dev/golang.org/x/[email protected]/http2/h2c