mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Add uTLS fingerprints support (#451)
This commit is contained in:
parent
e564d9ef7e
commit
a9e11075d1
7 changed files with 50 additions and 29 deletions
|
@ -3,6 +3,8 @@ package tcp
|
|||
import (
|
||||
"context"
|
||||
|
||||
utls "github.com/refraction-networking/utls"
|
||||
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/net"
|
||||
"github.com/xtls/xray-core/common/session"
|
||||
|
@ -21,14 +23,11 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||
|
||||
if config := tls.ConfigFromStreamSettings(streamSettings); config != nil {
|
||||
tlsConfig := config.GetTLSConfig(tls.WithDestination(dest))
|
||||
/*
|
||||
if config.IsExperiment8357() {
|
||||
conn = tls.UClient(conn, tlsConfig)
|
||||
} else {
|
||||
conn = tls.Client(conn, tlsConfig)
|
||||
}
|
||||
*/
|
||||
conn = tls.Client(conn, tlsConfig)
|
||||
if fingerprint, ok := tls.Fingerprints[config.Fingerprint]; ok {
|
||||
conn = utls.UClient(conn, tls.CopyConfig(tlsConfig), fingerprint)
|
||||
} else {
|
||||
conn = tls.Client(conn, tlsConfig)
|
||||
}
|
||||
} else if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil {
|
||||
xtlsConfig := config.GetXTLSConfig(xtls.WithDestination(dest))
|
||||
conn = xtls.Client(conn, xtlsConfig)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue