Fix v2rayquic default NextProtos

This commit is contained in:
HystericalDragon 2024-07-11 15:31:37 +08:00
parent 81e9eda357
commit d17d4c5340
No known key found for this signature in database
GPG Key ID: E205724F8931D99B
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import (
"sync"
"github.com/sagernet/quic-go"
"github.com/sagernet/quic-go/http3"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/tls"
C "github.com/sagernet/sing-box/constant"
@ -37,7 +38,7 @@ func NewClient(ctx context.Context, dialer N.Dialer, serverAddr M.Socksaddr, opt
DisablePathMTUDiscovery: !C.IsLinux && !C.IsWindows,
}
if len(tlsConfig.NextProtos()) == 0 {
tlsConfig.SetNextProtos([]string{"h2", "http/1.1"})
tlsConfig.SetNextProtos([]string{http3.NextProtoH3})
}
return &Client{
ctx: ctx,

View File

@ -8,6 +8,7 @@ import (
"os"
"github.com/sagernet/quic-go"
"github.com/sagernet/quic-go/http3"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/tls"
C "github.com/sagernet/sing-box/constant"
@ -34,7 +35,7 @@ func NewServer(ctx context.Context, options option.V2RayQUICOptions, tlsConfig t
DisablePathMTUDiscovery: !C.IsLinux && !C.IsWindows,
}
if len(tlsConfig.NextProtos()) == 0 {
tlsConfig.SetNextProtos([]string{"h2", "http/1.1"})
tlsConfig.SetNextProtos([]string{http3.NextProtoH3})
}
server := &Server{
ctx: ctx,