Skip to main content
Version: Next

ProxyInfo

The main purpose of the ProxyInfo object is to provide information about the current proxy connection used by the crawler for the request. Outside of crawlers, you can get this object by calling ProxyConfiguration.newProxyInfo.

Example usage:

const proxyConfiguration = new ProxyConfiguration({
proxyUrls: ['...', '...'] // List of Proxy URLs to rotate
});

// Getting proxyInfo object by calling class method directly
const proxyInfo = await proxyConfiguration.newProxyInfo();

// In crawler
const crawler = new CheerioCrawler({
// ...
proxyConfiguration,
requestHandler({ proxyInfo }) {
// Getting used proxy URL
const proxyUrl = proxyInfo.url;
}
})

Index

Properties

hostname

hostname: string

Hostname of your proxy.

optionalignoreTlsErrors

ignoreTlsErrors?: boolean = false

When true, the proxy is likely intercepting HTTPS traffic and is able to view and modify its content. The built-in HTTP clients and the browser pool disable TLS certificate verification for the session's requests when this is set.

password

password: string

User's password for the proxy.

port

port: string | number

Proxy port.

url

url: string

The URL of the proxy.

optionalusername

username?: string

Username for the proxy.