大约 1 分钟
Github:Danny-Dasilva/CycleTLS: Spoof TLS/JA3 fingerprints in GO and Javascript (github.com)
安装
npm config set proxy http://127.0.0.1:10809
npm install cycletls实例化
const initCycleTLS = require('cycletls');
// import initCycleTLS from 'cycletls';
// 同步方式
const cycleTLS = await initCycleTLS();
// 异步方式
initCycleTLS().then((cycleTLS) => {});实例方法
response = cycleTLS(url, [config]) // default "GET"
response = cycleTLS.get(url, [config])
response = cycleTLS.delete(url, [config])
response = cycleTLS.head(url, [config])
response = cycleTLS.options(url, [config])
response = cycleTLS.post(url, [config])
response = cycleTLS.put(url, [config])
response = cycleTLS.patch(url, [config])config
{
// URL for the request (required if not specified as an argument)
url: "https://example.com",
// Method for the request ("head" | "get" | "post" | "put" | "delete" | "trace" | "options" | "connect" | "patch")
method: "get", // Default method
// Custom headers to send
headers: { "Authorization": "Bearer someexampletoken" },
// Custom cookies to send
cookies: cookies,
// Body to send with request (must be a string - cannot pass an object)
body: '',
// JA3 token to send with request
ja3: '771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-51-57-47-53-10,0-23-65281-10-11-35-16-5-51-43-13-45-28-21,29-23-24-25-256-257,0',
// User agent for request
userAgent: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0',
// Proxy to send request through (must be in the same format)
proxy: 'http://username:password@hostname.com:443',
// Amount of seconds before request timeout (default: 7)
timeout: 2,
// Toggle if CycleTLS should follow redirects
disableRedirect: true,
// Custom header order to send with request (This value will overwrite default header order)
headerOrder: ["cache-control", "connection", "host"],
// Toggle if CycleTLS should skip verify certificate (If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host name in that certificate.)
insecureSkipVerify: false
// Forces CycleTLS to do a http1 handshake
forceHTTP1: false
}response
{
// Status code returned from server (Number)
status: 200,
// Body returned from the server (String)
body: "",
// Headers returned from the server (Object)
headers: {
"some": "header"
},
// FinalUrl returned from the server (String). This field is useful when redirection is active.
finalUrl: "https://final.url/"
}cookies
简易版
cookies = { "key1": "value1", "key2": "value2" }复杂版
interface Cookie { name: string; value: string; path?: string; domain?: string; expires?: string; rawExpires?: string; maxAge?: number; secure?: boolean; httpOnly?: boolean; sameSite?: string; unparsed?: string; } cookies = [Cookie]
