MCPcopy Create free account
hub / github.com/imroc/req / SetTLSFingerprint

Method SetTLSFingerprint

client.go:1227–1230  ·  view source on GitHub ↗

SetTLSFingerprint set the tls fingerprint for tls handshake, will use utls (https://github.com/refraction-networking/utls) to perform the tls handshake, which uses the specified clientHelloID to simulate the tls fingerprint. Note this is valid for HTTP1 and HTTP2, not HTTP3.

(clientHelloID utls.ClientHelloID)

Source from the content-addressed store, hash-verified

1225// which uses the specified clientHelloID to simulate the tls fingerprint.
1226// Note this is valid for HTTP1 and HTTP2, not HTTP3.
1227func (c *Client) SetTLSFingerprint(clientHelloID utls.ClientHelloID) *Client {
1228 c.setTLSFingerprint(clientHelloID, nil)
1229 return c
1230}
1231func (c *Client) setTLSFingerprint(clientHelloID utls.ClientHelloID, uTLSConnApply func(*uTLSConn) error) *Client {
1232 fn := func(ctx context.Context, addr string, plainConn net.Conn) (conn net.Conn, tlsState *tls.ConnectionState, err error) {
1233 colonPos := strings.LastIndex(addr, ":")

Callers 13

ImpersonateChromeMethod · 0.95
ImpersonateFirefoxMethod · 0.95
ImpersonateSafariMethod · 0.95
SetTLSFingerprintEdgeMethod · 0.95
SetTLSFingerprintQQMethod · 0.95
SetTLSFingerprint360Method · 0.95
SetTLSFingerprintIOSMethod · 0.95

Calls 1

setTLSFingerprintMethod · 0.95

Tested by

no test coverage detected