Skip to main content

proxy

Proxies requests, by a specified set of conditions, through either the Browserless residential proxy or through an external proxy. Only requests that match these conditions are proxied and the rest are sent from the instance's own IP address.

Use the "server" argument to specify an external proxy for Browserless to use for requests. For requests with authentication, the username and password should be included in the URL using Basic Authentication. See the examples below for more information on how to format those URLs.

Using the browserless proxy for all requests and proxy through Brazil

proxy(
url: "*"
country: BR
) {
time
}

Using an external proxy for all requests

proxy(
url: "*"
server: "http://username:password@my-proxy.com:12321"
) {
time
}

Using the Browserless proxy for only document requests and proxying through France

proxy(
url: "*"
type: document
country: FR
) {
time
}
proxy(
country: CountryType
city: String
state: String
sticky: Boolean
server: String
method: [Method]
operator: OperatorTypes = or
type: [ResourceType]
url: [String]
): ProxyResponse

Arguments

proxy.country ● CountryType enum

The country you wish to proxy through. Only allowed when using the browserless.io proxy and no server argument.

proxy.city ● String scalar

The city you wish to proxy through. Any spaces should be removed and all casing lowercase. For instance, "New York City" should be "newyorkcity"

proxy.state ● String scalar

The state or provence you wish to proxy through. Any spaces should be removed and all casing lowercase. For instance, "Rhode Island" would be "rhodeisland" and "New Brunswick" would be "newbrunswick"

proxy.sticky ● Boolean scalar

Whether or not you want the same IP to be used for subsequent requests matching the pattern

proxy.server ● String scalar

An external proxy to use for these requests matching the specified patterns set in the other arguments. When this is set then country, city, state and sticky options will throw errors as these are only valid for the browserless.io proxy network

proxy.method ● [Method] list enum

The Method(s) of the request you'd like to proxy

proxy.operator ● OperatorTypes enum

Whether to "or" conditions together, meaning any condition that matches will be proxied, or "and" them together meaning every condition must match to proxy the request.

proxy.type ● [ResourceType] list enum

The content-type of the request you'd like to proxy requests to

proxy.url ● [String] list scalar

A glob-style URL pattern to match requests, and if matched, are proxied through

Type

ProxyResponse object

Response returned after setting up the proxy patterns