diff --git a/proxy/http/client.go b/proxy/http/client.go index 316ed74a3..36aa0cfa6 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -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 {