Update quic-go to v0.43.0

This commit is contained in:
世界 2024-04-28 13:14:04 +08:00
parent d718f1b9fd
commit 06b1a91367
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
5 changed files with 9 additions and 10 deletions

View file

@ -15,7 +15,7 @@ import (
type Config interface {
Dial(ctx context.Context, conn net.PacketConn, addr net.Addr, config *quic.Config) (quic.Connection, error)
DialEarly(ctx context.Context, conn net.PacketConn, addr net.Addr, config *quic.Config) (quic.EarlyConnection, error)
CreateTransport(conn net.PacketConn, quicConnPtr *quic.EarlyConnection, serverAddr M.Socksaddr, quicConfig *quic.Config, enableDatagrams bool) http.RoundTripper
CreateTransport(conn net.PacketConn, quicConnPtr *quic.EarlyConnection, serverAddr M.Socksaddr, quicConfig *quic.Config) http.RoundTripper
}
type ServerConfig interface {
@ -58,9 +58,9 @@ func DialEarly(ctx context.Context, conn net.PacketConn, addr net.Addr, config a
return quic.DialEarly(ctx, conn, addr, tlsConfig, quicConfig)
}
func CreateTransport(conn net.PacketConn, quicConnPtr *quic.EarlyConnection, serverAddr M.Socksaddr, config aTLS.Config, quicConfig *quic.Config, enableDatagrams bool) (http.RoundTripper, error) {
func CreateTransport(conn net.PacketConn, quicConnPtr *quic.EarlyConnection, serverAddr M.Socksaddr, config aTLS.Config, quicConfig *quic.Config) (http.RoundTripper, error) {
if quicTLSConfig, isQUICConfig := config.(Config); isQUICConfig {
return quicTLSConfig.CreateTransport(conn, quicConnPtr, serverAddr, quicConfig, enableDatagrams), nil
return quicTLSConfig.CreateTransport(conn, quicConnPtr, serverAddr, quicConfig), nil
}
tlsConfig, err := config.Config()
if err != nil {
@ -68,8 +68,7 @@ func CreateTransport(conn net.PacketConn, quicConnPtr *quic.EarlyConnection, ser
}
return &http3.RoundTripper{
TLSClientConfig: tlsConfig,
QuicConfig: quicConfig,
EnableDatagrams: enableDatagrams,
QUICConfig: quicConfig,
Dial: func(ctx context.Context, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlyConnection, error) {
quicConn, err := quic.DialEarly(ctx, conn, serverAddr.UDPAddr(), tlsCfg, cfg)
if err != nil {