mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Refine randomized
But we should avoid using it unless we have to, see https://github.com/refraction-networking/utls/pull/157#issuecomment-1417156797
This commit is contained in:
parent
c3faa8b7ac
commit
f32921df30
3 changed files with 18 additions and 11 deletions
|
@ -12,6 +12,13 @@ import (
|
|||
|
||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
||||
|
||||
type Interface interface {
|
||||
net.Conn
|
||||
Handshake() error
|
||||
VerifyHostname(host string) error
|
||||
NegotiatedProtocol() (name string, mutual bool)
|
||||
}
|
||||
|
||||
var _ buf.Writer = (*Conn)(nil)
|
||||
|
||||
type Conn struct {
|
||||
|
@ -125,6 +132,13 @@ func init() {
|
|||
}
|
||||
i++
|
||||
}
|
||||
weights := utls.DefaultWeights
|
||||
weights.TLSVersMax_Set_VersionTLS13 = 1
|
||||
weights.FirstKeyShare_Set_CurveP256 = 0
|
||||
randomized := utls.HelloRandomized
|
||||
randomized.Seed, _ = utls.NewPRNGSeed()
|
||||
randomized.Weights = &weights
|
||||
PresetFingerprints["randomized"] = &randomized
|
||||
}
|
||||
|
||||
func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
|
||||
|
@ -154,7 +168,7 @@ var PresetFingerprints = map[string]*utls.ClientHelloID{
|
|||
"360": &utls.Hello360_Auto,
|
||||
"qq": &utls.HelloQQ_Auto,
|
||||
"random": nil,
|
||||
"randomized": &utls.HelloRandomized,
|
||||
"randomized": nil,
|
||||
}
|
||||
|
||||
var ModernFingerprints = map[string]*utls.ClientHelloID{
|
||||
|
@ -203,10 +217,3 @@ var OtherFingerprints = map[string]*utls.ClientHelloID{
|
|||
"helloios_11_1": &utls.HelloIOS_11_1,
|
||||
"hello360_7_5": &utls.Hello360_7_5,
|
||||
}
|
||||
|
||||
type Interface interface {
|
||||
net.Conn
|
||||
Handshake() error
|
||||
VerifyHostname(host string) error
|
||||
NegotiatedProtocol() (name string, mutual bool)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue