feat: tuic outbound allow set an empty ALPN array

This commit is contained in:
wwqgtxx
2023-07-16 10:29:43 +08:00
parent f73f32e41c
commit 9cbca162a0
2 changed files with 4 additions and 1 deletions

View File

@ -162,7 +162,7 @@ func NewTuic(option TuicOption) (*Tuic, error) {
tlsConfig = tlsC.GetGlobalTLSConfig(tlsConfig)
}
if len(option.ALPN) > 0 {
if option.ALPN != nil { // structure's Decode will ensure value not nil when input has value even it was set an empty array
tlsConfig.NextProtos = option.ALPN
} else {
tlsConfig.NextProtos = []string{"h3"}