Documentation ¶
Index ¶
- Variables
- func AddPsk(obj *Ja3Spec)
- func ConnContext(ctx context.Context, c net.Conn) context.Context
- func DelPsk(obj *Ja3Spec)
- func GetConfigForClient(chi *tls.ClientHelloInfo) (*tls.Config, error)
- func NewClient(ctx context.Context, conn net.Conn, ja3Spec Ja3Spec, disHttp2 bool, ...) (utlsConn *utls.UConn, err error)
- func Pipe(preCtx context.Context) (net.Conn, net.Conn)
- func ShuffleExtensions(chs *Ja3Spec)
- func Utls2Tls(preCtx, ctx context.Context, utlsConn *utls.UConn, host string) (*tls.Conn, error)
- func VerifyWithMd5(md string) (string, bool)
- type Addr
- type ClientHello
- type ClientHelloId
- type ClientSessionCache
- type Conn
- func (obj *Conn) Close() error
- func (obj *Conn) LocalAddr() net.Addr
- func (obj *Conn) Read(b []byte) (n int, err error)
- func (obj *Conn) RemoteAddr() net.Addr
- func (obj *Conn) SetDeadline(t time.Time) error
- func (obj *Conn) SetReadDeadline(t time.Time) error
- func (obj *Conn) SetWriteDeadline(t time.Time) error
- func (obj *Conn) Write(b []byte) (n int, err error)
- type H2Ja3Spec
- type Ja3ContextData
- type Ja3Spec
- type OneSessionCache
- type Priority
- type Setting
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HelloGolang will use default "crypto/tls" handshake marshaling codepath, which WILL // overwrite your changes to Hello(Config, Session are fine). // You might want to call BuildHandshakeState() before applying any changes. // UConn.Extensions will be completely ignored. HelloGolang = utls.HelloGolang // HelloCustom will prepare ClientHello with empty uconn.Extensions so you can fill it with // TLSExtensions manually or use ApplyPreset function HelloCustom = utls.HelloCustom // HelloRandomized* randomly adds/reorders extensions, ciphersuites, etc. HelloRandomized = utls.HelloRandomized HelloRandomizedALPN = utls.HelloRandomizedALPN HelloRandomizedNoALPN = utls.HelloRandomizedNoALPN // The rest will will parrot given browser. HelloFirefox_Auto = utls.HelloFirefox_Auto HelloFirefox_55 = utls.HelloFirefox_55 HelloFirefox_56 = utls.HelloFirefox_56 HelloFirefox_63 = utls.HelloFirefox_63 HelloFirefox_65 = utls.HelloFirefox_65 HelloFirefox_99 = utls.HelloFirefox_99 HelloFirefox_102 = utls.HelloFirefox_102 HelloFirefox_105 = utls.HelloFirefox_105 HelloChrome_Auto = utls.HelloChrome_Auto HelloChrome_58 = utls.HelloChrome_58 HelloChrome_62 = utls.HelloChrome_62 HelloChrome_70 = utls.HelloChrome_70 HelloChrome_72 = utls.HelloChrome_72 HelloChrome_83 = utls.HelloChrome_83 HelloChrome_87 = utls.HelloChrome_87 HelloChrome_96 = utls.HelloChrome_96 HelloChrome_100 = utls.HelloChrome_100 HelloChrome_102 = utls.HelloChrome_102 HelloChrome_106_Shuffle = utls.HelloChrome_106_Shuffle // Chrome w/ PSK: Chrome start sending this ClientHello after doing TLS 1.3 handshake with the same server. // Beta: PSK extension added. However, uTLS doesn't ship with full PSK support. // Use at your own discretion. HelloChrome_100_PSK = utls.HelloChrome_100_PSK HelloChrome_112_PSK_Shuf = utls.HelloChrome_112_PSK_Shuf HelloChrome_114_Padding_PSK_Shuf = utls.HelloChrome_114_Padding_PSK_Shuf // Chrome w/ Post-Quantum Key Agreement // Beta: PQ extension added. However, uTLS doesn't ship with full PQ support. Use at your own discretion. HelloChrome_115_PQ = utls.HelloChrome_115_PQ HelloChrome_115_PQ_PSK = utls.HelloChrome_115_PQ_PSK HelloIOS_Auto = utls.HelloIOS_Auto HelloIOS_11_1 = utls.HelloIOS_11_1 HelloIOS_12_1 = utls.HelloIOS_12_1 HelloIOS_13 = utls.HelloIOS_13 HelloIOS_14 = utls.HelloIOS_14 HelloAndroid_11_OkHttp = utls.HelloAndroid_11_OkHttp HelloEdge_Auto = utls.HelloEdge_Auto HelloEdge_85 = utls.HelloEdge_85 HelloEdge_106 = utls.HelloEdge_106 HelloSafari_Auto = utls.HelloSafari_Auto HelloSafari_16_0 = utls.HelloSafari_16_0 Hello360_Auto = utls.Hello360_Auto Hello360_7_5 = utls.Hello360_7_5 Hello360_11_0 = utls.Hello360_11_0 HelloQQ_Auto = utls.HelloQQ_Auto HelloQQ_11_1 = utls.HelloQQ_11_1 )
Functions ¶
func GetConfigForClient ¶
func GetConfigForClient(chi *tls.ClientHelloInfo) (*tls.Config, error)
func ShuffleExtensions ¶
func ShuffleExtensions(chs *Ja3Spec)
func VerifyWithMd5 ¶
Types ¶
type ClientHello ¶
type ClientHello struct { ServerName string SupportedProtos []string //列出客户端支持的应用协议。[h2 http/1.1] SupportedPoints []uint8 //列出了客户端支持的点格式[0] SupportedCurves []tls.CurveID //列出了客户端支持的椭圆曲线。 [CurveID(2570) X25519 CurveP256 CurveP384] SupportedVersions []uint16 //列出了客户端支持的TLS版本。[2570 772 771] CipherSuites []uint16 //客户端支持的密码套件 [14906 4865 4866 4867 49195 49199 49196 49200 52393 52392 49171 49172 156 157 47 53] SignatureSchemes []tls.SignatureScheme //列出了客户端愿意验证的签名和散列方案[ECDSAWithP256AndSHA256 PSSWithSHA256 PKCS1WithSHA256 ECDSAWithP384AndSHA384 PSSWithSHA384 PKCS1WithSHA384 PSSWithSHA512 PKCS1WithSHA512] }
type ClientHelloId ¶
type ClientHelloId = utls.ClientHelloID
type ClientSessionCache ¶
type ClientSessionCache struct {
// contains filtered or unexported fields
}
func NewClientSessionCache ¶
func NewClientSessionCache() *ClientSessionCache
func (*ClientSessionCache) Get ¶
func (obj *ClientSessionCache) Get(sessionKey string) (session *utls.ClientSessionState, ok bool)
func (*ClientSessionCache) Put ¶
func (obj *ClientSessionCache) Put(sessionKey string, cs *utls.ClientSessionState)
func (*ClientSessionCache) Session ¶
func (obj *ClientSessionCache) Session() *utls.ClientSessionState
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶
type H2Ja3Spec ¶
type H2Ja3Spec struct { InitialSetting []Setting ConnFlow uint32 //WINDOW_UPDATE:15663105 OrderHeaders []string //伪标头顺序,例如:[]string{":method",":authority",":scheme",":path"} Priority Priority }
func DefaultH2Ja3Spec ¶
func DefaultH2Ja3Spec() H2Ja3Spec
type Ja3ContextData ¶
type Ja3ContextData struct { ClientHello ClientHello `json:"clientHello"` Init bool `json:"init"` }
func GetRequestJa3Data ¶
func GetRequestJa3Data(r *http.Request) *Ja3ContextData
func (Ja3ContextData) Md5 ¶
func (obj Ja3ContextData) Md5() string
func (Ja3ContextData) Verify ¶
func (obj Ja3ContextData) Verify() (string, bool)
type Ja3Spec ¶
type Ja3Spec utls.ClientHelloSpec
func CreateSpecWithId ¶
func CreateSpecWithId(ja3Id ClientHelloId) (clientHelloSpec Ja3Spec, err error)
ja3 clientHelloId 生成 clientHello
func CreateSpecWithStr ¶
ja3 字符串中生成 clientHello
func DefaultJa3Spec ¶
func DefaultJa3Spec() Ja3Spec
type OneSessionCache ¶
type OneSessionCache struct {
// contains filtered or unexported fields
}
func NewOneSessionCache ¶
func NewOneSessionCache(session *utls.ClientSessionState) *OneSessionCache
func (*OneSessionCache) Get ¶
func (obj *OneSessionCache) Get(sessionKey string) (*utls.ClientSessionState, bool)
func (*OneSessionCache) Put ¶
func (obj *OneSessionCache) Put(sessionKey string, cs *utls.ClientSessionState)
func (*OneSessionCache) Session ¶
func (obj *OneSessionCache) Session() *utls.ClientSessionState
type Priority ¶
type Priority struct { // StreamDep is a 31-bit stream identifier for the // stream that this stream depends on. Zero means no // dependency. StreamDep uint32 // Exclusive is whether the dependency is exclusive. Exclusive bool // Weight is the stream's zero-indexed weight. It should be // set together with StreamDep, or neither should be set. Per // the spec, "Add one to the value to obtain a weight between // 1 and 256." Weight uint8 }
type Setting ¶
type Setting struct { // ID is which setting is being set. // See https://httpwg.org/specs/rfc7540.html#SettingFormat Id uint16 // Val is the value. Val uint32 }
Click to show internal directories.
Click to hide internal directories.