Skip to main content
Version: 3.12

ProxyConfigurationOptions

Index

Properties

optionalnewUrlFunction

Custom function that allows you to generate the new proxy URL dynamically. It gets the sessionId as a parameter and an optional parameter with the Request object when applicable. Can return either stringified proxy URL or null if the proxy should not be used. Can be asynchronous.

This function is used to generate the URL when ProxyConfiguration.newUrl or ProxyConfiguration.newProxyInfo is called.

optionalproxyUrls

proxyUrls?: string[]

An array of custom proxy URLs to be rotated. Custom proxies are not compatible with Apify Proxy and an attempt to use both configuration options will cause an error to be thrown on initialize.

optionaltieredProxyUrls

tieredProxyUrls?: string[][]

An array of custom proxy URLs to be rotated stratified in tiers. This is a more advanced version of proxyUrls that allows you to define a hierarchy of proxy URLs If everything goes well, all the requests will be sent through the first proxy URL in the list. Whenever the crawler encounters a problem with the current proxy on the given domain, it will switch to the higher tier for this domain. The crawler probes lower-level proxies at intervals to check if it can make the tier downshift.

This feature is useful when you have a set of proxies with different performance characteristics (speed, price, antibot performance etc.) and you want to use the best one for each domain.