Documentation ¶
Index ¶
- Constants
- Variables
- func CreateUrlPatternMatcher(pattern string) func(string) bool
- func FetchUrl(req *http.Request, impersonate string, insecure bool, timeout int, ...) (*http.Response, error)
- func MatchUrlPattern(pattern string, optionalUrl string) bool
- func ParseProxyFromEnv(urlStr string) string
- type ImpersonateProfile
Constants ¶
View Source
const (
HTTP_HEADER_PLACEHOLDER = "\n"
)
Variables ¶
View Source
var ImpersonateProfiles = map[string]*ImpersonateProfile{ "chrome120": { Navigator: "chrome", Comment: "Chrome 120 on Windows 11 x64 en-US", Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,65281-45-11-65037-18-5-51-0-23-27-43-16-10-35-17513-13,29-23-24,0", H2fingerprint: "1:65536,2:0,4:6291456,6:262144|15663105|0|m,a,s,p", Headers: [][]string{ {"Cache-Control", "max-age=0"}, {"Sec-Ch-Ua", `"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"`}, {"Sec-Ch-Ua-Mobile", `?0`}, {"Sec-Ch-Ua-Platform", `"Windows"`}, {"Upgrade-Insecure-Requests", "1"}, {"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"}, {"Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"}, {"Sec-Fetch-Site", `none`}, {"Sec-Fetch-Mode", `navigate`}, {"Sec-Fetch-User", `?1`}, {"Sec-Fetch-Dest", `document`}, {"Accept-Language", "en-US,en;q=0.9"}, {"Cookie", HTTP_HEADER_PLACEHOLDER}, }, }, "chrome122": { Name: "chrome122", Navigator: "chrome", Comment: "Chrome 122 on Windows 11 x64 en-US", Ja3: "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,23-13-27-16-51-65281-45-5-17513-0-35-43-65037-11-18-10,29-23-24,0", H2fingerprint: "1:65536,2:0,4:6291456,6:262144|15663105|0|m,a,s,p", Headers: [][]string{ {"Cache-Control", "max-age=0"}, {"Sec-Ch-Ua", `"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"`}, {"Sec-Ch-Ua-Mobile", `?0`}, {"Sec-Ch-Ua-Platform", `"Windows"`}, {"Upgrade-Insecure-Requests", "1"}, {"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"}, {"Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"}, {"Sec-Fetch-Site", `none`}, {"Sec-Fetch-Mode", `navigate`}, {"Sec-Fetch-User", `?1`}, {"Sec-Fetch-Dest", `document`}, {"Accept-Encoding", "gzip, deflate, br, zstd"}, {"Accept-Language", "en-US,en;q=0.9"}, {"Cookie", HTTP_HEADER_PLACEHOLDER}, }, }, "firefox121": { Navigator: "firefox", Comment: "Firefox 121 on Windows 11 x64 en-US", Ja3: "771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-51-43-13-45-28-65037,29-23-24-25-256-257,0", H2fingerprint: "1:65536,4:131072,5:16384|12517377|3:0:0:201,5:0:0:101,7:0:0:1,9:0:7:1,11:0:3:1,13:0:0:241|m,p,a,s", Headers: [][]string{ {"User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"}, {"Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"}, {"Accept-Language", "en-US,en;q=0.5"}, {"Accept-Encoding", "gzip, deflate, br"}, {"Cookie", HTTP_HEADER_PLACEHOLDER}, {"Upgrade-Insecure-Requests", "1"}, {"Sec-Fetch-Dest", `document`}, {"Sec-Fetch-Mode", `navigate`}, {"Sec-Fetch-Site", `none`}, {"Sec-Fetch-User", `?1`}, {"te", "trailers"}, }, }, }
View Source
var ( // all supported impersonate names Impersonates []string )
Functions ¶
func CreateUrlPatternMatcher ¶ added in v0.6.0
Create a Chrome extension match pattern style matcher, that test a url against the pattern. Mattern syntax: https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns . Pattern examples: https://*/ , https://*/foo* , https://*.google.com/foo*bar . Adapted from https://github.com/nickclaw/url-match-patterns
func MatchUrlPattern ¶ added in v0.6.0
func ParseProxyFromEnv ¶ added in v0.4.0
Parse standard HTTP_PROXY, HTTPS_PROXY, NO_PROXY (and lowercase versions) envs, return proxy for urlStr.
Types ¶
Click to show internal directories.
Click to hide internal directories.