proxy

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyProxyAuth

func ApplyProxyAuth(page *rod.Page, proxyURL string) error

ApplyProxyAuth wires CDP Fetch interception on the page so that basic-auth challenges issued by an upstream proxy (e.g. Bright Data, Smartproxy) are answered automatically with the credentials embedded in proxyURL.

Chromium ignores user:password embedded in --proxy-server URLs and instead surfaces a blocking basic-auth dialog. The work-around is to enable Fetch.enable{handleAuthRequests:true} and respond to Fetch.authRequired via Fetch.continueWithAuth.

If proxyURL is empty or carries no credentials, this is a silent no-op.

func ParseProxyList

func ParseProxyList(s string) []string

ParseProxyList splits a proxy list on commas, newlines and spaces, trims each entry and drops empties. Accepts the value of --proxy-list or the GHOSTCHROME_PROXY_LIST env (or the contents of a file passed to either).

Types

type ProxyPool

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

ProxyPool hands out proxy URLs round-robin across sessions. Residential / mobile proxies are usually sold as a pool; rotating the egress IP is the #1 lever against IP-reputation anti-bot layers (DataDome & co.), which a single static --proxy cannot provide. Thread-safe.

func NewProxyPool

func NewProxyPool(entries []string) *ProxyPool

NewProxyPool builds a pool from already-parsed entries. A nil/empty list yields an empty pool whose Next() returns "".

func (*ProxyPool) Len

func (p *ProxyPool) Len() int

Len reports how many proxies are in the pool.

func (*ProxyPool) Next

func (p *ProxyPool) Next() string

Next returns the next proxy round-robin, or "" when the pool is empty (so callers can fall back to the global --proxy / direct connection).

Jump to

Keyboard shortcuts

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