mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-29 10:15:17 +08:00
初步实现HTTP3
This commit is contained in:
@@ -463,3 +463,13 @@ func (this *ServerConfig) ShouldCheckTrafficLimit() bool {
|
||||
func (this *ServerConfig) PlanId() int64 {
|
||||
return this.planId
|
||||
}
|
||||
|
||||
// SupportsHTTP3 是否支持HTTP/3
|
||||
func (this *ServerConfig) SupportsHTTP3() bool {
|
||||
return this.isOk &&
|
||||
this.HTTPS != nil &&
|
||||
this.HTTPS.IsOn &&
|
||||
this.HTTPS.SSLPolicy != nil &&
|
||||
this.HTTPS.SSLPolicy.IsOn &&
|
||||
this.HTTPS.SSLPolicy.HTTP3Enabled
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ type SSLPolicy struct {
|
||||
CipherSuites []TLSCipherSuite `yaml:"cipherSuites" json:"cipherSuites"` // 加密算法套件
|
||||
|
||||
HSTS *HSTSConfig `yaml:"hsts" json:"hsts"` // HSTS配置
|
||||
HTTP2Enabled bool `yaml:"http2Enabled" json:"http2Enabled"` // 是否启用HTTP2
|
||||
HTTP2Enabled bool `yaml:"http2Enabled" json:"http2Enabled"` // 是否启用HTTP/2
|
||||
HTTP3Enabled bool `yaml:"http3Enabled" json:"http3Enabled"` // 是否启用HTTP/3
|
||||
|
||||
OCSPIsOn bool `yaml:"ocspIsOn" json:"ocspIsOn"` // 是否启用OCSP
|
||||
|
||||
@@ -110,7 +111,7 @@ func (this *SSLPolicy) Init(ctx context.Context) error {
|
||||
cipherSuites = nil
|
||||
}
|
||||
|
||||
nextProto := []string{}
|
||||
var nextProto = []string{}
|
||||
if this.HTTP2Enabled {
|
||||
nextProto = []string{http2.NextProtoTLS}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user