feat: make native TLS protocol boundary explicit

This commit is contained in:
2026-09-22 18:39:57 +08:00
parent 4a8feaca36
commit a523e6ba3f
6 changed files with 93 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ if err := application.RunWith(ctx, server, ":8443"); err != nil {
需要自己持有 listener 或配置证书文件时,分别使用 `ServeTLS` 或 `RunTLS`;TLS 握手仍受 native 的读超时、连接上限和优雅关闭控制,Handler 可通过 `Request.TLS` 读取标准 `tls.ConnectionState`。
native 当前只宣告 TLS ALPN `http/1.1`。未配置 `NextProtos` 时会自动补上;如果配置了 `h2` 等未实现协议,服务会在启动时直接返回错误,避免 TLS 协商成功后再被 HTTP/1.1 解析器拒绝。需要 HTTP/2 时,先让 Nginx/Cloudflare 在边缘终止 HTTP/2,再以 HTTP/1.1 回源;或继续使用默认的 `transport/nethttp` 适配器。native 的 HTTP/2 会在独立协议设计和压测完成后再进入。
## 可移植路由规则(v0.3.0)
| 项目 | 约定 |