mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-20 00:07:06 -05:00
Fix HTTP2 proxy client with uTLS
This commit is contained in:
parent
cefddb0aa4
commit
c1bc8a0a42
@ -27,7 +27,7 @@ import (
|
|||||||
"github.com/v2fly/v2ray-core/v5/proxy"
|
"github.com/v2fly/v2ray-core/v5/proxy"
|
||||||
"github.com/v2fly/v2ray-core/v5/transport"
|
"github.com/v2fly/v2ray-core/v5/transport"
|
||||||
"github.com/v2fly/v2ray-core/v5/transport/internet"
|
"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 {
|
type Client struct {
|
||||||
@ -288,12 +288,12 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
nextProto := ""
|
nextProto := ""
|
||||||
if tlsConn, ok := iConn.(*tls.Conn); ok {
|
if connALPNGetter, ok := iConn.(security.ConnectionApplicationProtocol); ok {
|
||||||
if err := tlsConn.Handshake(); err != nil {
|
nextProto, err = connALPNGetter.GetConnectionApplicationProtocol()
|
||||||
|
if err != nil {
|
||||||
rawConn.Close()
|
rawConn.Close()
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
nextProto = tlsConn.ConnectionState().NegotiatedProtocol
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch nextProto {
|
switch nextProto {
|
||||||
|
Loading…
Reference in New Issue
Block a user