1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-09 11:51:02 -05:00

Fix HTTP2 proxy client with uTLS

This commit is contained in:
dyhkwong 2024-08-03 14:40:02 +08:00 committed by Xiaokang Wang (Shelikhoo)
parent cefddb0aa4
commit c1bc8a0a42

View File

@ -27,7 +27,7 @@ import (
"github.com/v2fly/v2ray-core/v5/proxy"
"github.com/v2fly/v2ray-core/v5/transport"
"github.com/v2fly/v2ray-core/v5/transport/internet"
"github.com/v2fly/v2ray-core/v5/transport/internet/tls"
"github.com/v2fly/v2ray-core/v5/transport/internet/security"
)
type Client struct {
@ -288,12 +288,12 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
}
nextProto := ""
if tlsConn, ok := iConn.(*tls.Conn); ok {
if err := tlsConn.Handshake(); err != nil {
if connALPNGetter, ok := iConn.(security.ConnectionApplicationProtocol); ok {
nextProto, err = connALPNGetter.GetConnectionApplicationProtocol()
if err != nil {
rawConn.Close()
return nil, nil, err
}
nextProto = tlsConn.ConnectionState().NegotiatedProtocol
}
switch nextProto {