stealthhttp

package
v0.0.0-...-9944d71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package stealthhttp provides a stealth HTTP client that mimics browser fingerprints to bypass Cloudflare and other anti-bot protections without external APIs.

Package stealthhttp provides utilities for extracting contact information

Index

Constants

This section is empty.

Variables

View Source
var DefaultUserAgents = []string{
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
	"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Safari/605.1.15",
	"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
}

DefaultUserAgents are common browser user agents

View Source
var DefaultWebProxies = []WebProxy{
	{
		Name:       "CroxyProxy",
		URLPattern: "https://www.croxyproxy.com/browse.php?u=%s&b=4",
		Enabled:    true,
	},
	{
		Name:       "ProxySite",
		URLPattern: "https://www.proxysite.com/go/%s",
		Enabled:    false,
	},
}

DefaultWebProxies are fallback web proxies when direct requests fail

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a stealth HTTP client that mimics browser TLS fingerprints

func New

func New(opts ...ClientOption) *Client

New creates a new stealth HTTP client

func (*Client) AddProxy

func (c *Client) AddProxy(proxy string)

AddProxy adds a proxy to the rotation pool

func (*Client) Get

func (c *Client) Get(ctx context.Context, targetURL string) *Response

Get performs a GET request with browser impersonation

func (*Client) SetProxies

func (c *Client) SetProxies(proxies []string)

SetProxies replaces the proxy list

type ClientOption

type ClientOption func(*Client)

ClientOption configures the Client

func WithMaxRetries

func WithMaxRetries(retries int) ClientOption

WithMaxRetries sets the maximum number of retries

func WithProxies

func WithProxies(proxies []string) ClientOption

WithProxies sets the proxy list for rotation

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout sets the request timeout

func WithWebProxyFallback

func WithWebProxyFallback(enabled bool) ClientOption

WithWebProxyFallback enables web proxy fallback when direct requests fail

type ContactInfo

type ContactInfo struct {
	Emails    []string
	Phones    []string
	Facebook  string
	Instagram string
	Twitter   string
	LinkedIn  string
	WhatsApp  string
	YouTube   string
	TikTok    string
	Pinterest string
}

ContactInfo holds extracted contact information

func ExtractFromHTML

func ExtractFromHTML(body []byte) *ContactInfo

ExtractFromHTML extracts contact information from HTML content

type Response

type Response struct {
	StatusCode   int
	Body         []byte
	Headers      http.Header
	URL          string
	UsedProxy    string
	UsedWebProxy string
	Error        error
}

Response wraps the HTTP response with additional metadata

type WebProxy

type WebProxy struct {
	Name       string
	URLPattern string // URL pattern with %s for target URL
	Enabled    bool
}

WebProxy represents a web-based proxy service (like CroxyProxy)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL