mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-02-07 08:30:37 +00:00
RAW: Allow setting ALPN http/1.1
for non-REALITY uTLS
https://github.com/XTLS/Xray-core/issues/4313#issuecomment-2611889517
This commit is contained in:
parent
2522cfd7be
commit
740a6b0dcd
|
@ -24,9 +24,15 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
||||||
tlsConfig := config.GetTLSConfig(tls.WithDestination(dest))
|
tlsConfig := config.GetTLSConfig(tls.WithDestination(dest))
|
||||||
if fingerprint := tls.GetFingerprint(config.Fingerprint); fingerprint != nil {
|
if fingerprint := tls.GetFingerprint(config.Fingerprint); fingerprint != nil {
|
||||||
conn = tls.UClient(conn, tlsConfig, fingerprint)
|
conn = tls.UClient(conn, tlsConfig, fingerprint)
|
||||||
|
if len(tlsConfig.NextProtos) == 1 && tlsConfig.NextProtos[0] == "http/1.1" {
|
||||||
|
if err := conn.(*tls.UConn).WebsocketHandshakeContext(ctx); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if err := conn.(*tls.UConn).HandshakeContext(ctx); err != nil {
|
if err := conn.(*tls.UConn).HandshakeContext(ctx); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
conn = tls.Client(conn, tlsConfig)
|
conn = tls.Client(conn, tlsConfig)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue