Why a site blocks a machine
A machine’s outbound IPv4 traffic leaves from the public address of the host it runs on. Every machine on that host shares the address, including machines of other accounts. The address belongs to a cloud or datacenter provider, and sites that fight bots often refuse such addresses whatever the request looks like. The address can also change, because a machine may start or resume on another host. InstaBox has no fixed or dedicated outbound address for a machine, so a proxy is also the way to get one. On some hosts a machine also has a public IPv6 address of its own. A request that does not go through the proxy can leave from that address when the site supports IPv6, and so can WebRTC.Choose a proxy
Pick the kind of proxy by what the site checks. This table lists the common kinds.
Ask the provider for two things:
- Username and password sign-in. Do not use the provider’s IP allowlist for the machine’s address, because the machine shares that address with other accounts and the address can change.
- An HTTP proxy endpoint. Every tool on this page works with one. A SOCKS5 endpoint also works with
curl. Python needs an extra package for SOCKS5,
requests[socks]orhttpx[socks]. Chromium cannot sign in to a SOCKS5 proxy.
http://USER:PASS@proxy.example.com:8080 as the proxy URL. Put your provider’s host,
port, username, and password in its place.
Save the proxy URL as a Secret
The proxy URL holds your proxy password, so keep it out of your code and your shell history. Save it as a direct Secret, which puts the real value in the machine as an environment variable. The CLI prompts for the value without echo.exec, SSH,
the dashboard terminal) then has the variable PROXY_URL.
instabox secrets select scraper --secret-env PROXY_URL.
Check the address a site sees
Ask a service that answers with the caller’s address, first without the proxy and then through it. The first command prints the machine’s datacenter address.-x option. It prints an
address of your proxy provider.
Point a tool at the proxy
Give the proxy to the one tool that needs it. Your other traffic, such as package installs and model API calls, then stays off the proxy, which most providers bill by the gigabyte.Python
requests and httpx both take the proxy URL in code. Neither is preinstalled, so install the one
you use into a virtual environment first. This example uses requests.
httpx, pass the URL as proxy when you make the client.
Node.js
Node’s built-infetch takes a proxy as a dispatcher. Install undici in your project, and pass
its ProxyAgent with the request.
Playwright
Installplaywright in your project, then run npx playwright install chromium to download its
Chromium. To use the template’s Chromium and skip the download, add
executablePath: '/usr/bin/chromium' to the launch options.
Playwright takes the proxy’s address, username, and password as separate fields, so split the URL.
The two args keep WebRTC behind the proxy, as
Keep WebRTC behind the proxy explains.
bypass to proxy, for example bypass: 'api.example.com'.
Chromium
When you start Chromium yourself, pass the proxy with--proxy-server. The flag takes the address
only.
USER:PASS@ in the flag, every
page fails with ERR_NO_SUPPORTED_PROXIES. For a proxy that needs a sign-in, start the browser from
Playwright as above, which answers the proxy’s sign-in for you.
Send all of a shell’s traffic through the proxy
Most command-line tools read the proxy from environment variables, so you can set them once for a shell and not pass the proxy to each tool. Set both the upper-case and the lower-case names, because tools differ in which ones they read. curl, for example, readshttp_proxy only in lower case.
NO_PROXY, separated by commas.
requests, and httpx read these variables. Node.js reads them only when you also set
NODE_USE_ENV_PROXY=1, which Node.js 22 in the templates supports. Node.js then prints a warning
that EnvHttpProxyAgent is experimental.
ERR_INVALID_AUTH_CREDENTIALS, and the Chromium that
Playwright downloads waits until the page load times out. Give a browser its proxy from Playwright.
Keep Org Secrets working
Org Secrets replaces a placeholder with the real credential only in HTTPS requests that go straight from the machine to an allowed host. A request that goes through your proxy is hidden inside the connection to the proxy, so the placeholder is not replaced. The API then receivesibsec_... and refuses it, usually with 401.
If a machine uses Org Secrets, keep each Secret’s hosts off your proxy. When you give the proxy to one
tool, as under Point a tool at the proxy, the other tools are not
affected. When you set the variables for a whole shell, add every Secret host to NO_PROXY.
Keep WebRTC behind the proxy
A proxy carries a browser’s HTTP and HTTPS traffic. WebRTC sends UDP packets straight from the machine by default, and a page can use them to learn the machine’s real address. To make Chromium keep WebRTC behind the proxy, start it with these two flags. Pass both, because Chromium builds differ in which one they read. The template’s Chromium reads the first, and the Chromium that Playwright downloads reads the second.Limits
DNS lookups do not go through the proxy by default
DNS lookups do not go through the proxy by default
With an HTTP proxy, the proxy looks up the name of the site, so the machine’s resolver never sees
it. With a SOCKS5 proxy, write the URL as
socks5h:// so that the proxy looks the name up. With
socks5://, the machine looks the name up itself.The machine always looks up the proxy’s own hostname itself. InstaBox answers a machine’s DNS
queries on port 53 with its own resolver, whatever resolver the machine names. It blocks DNS over
TLS on port 853, and DNS over HTTPS to well-known public resolvers such as 1.1.1.1 and 8.8.8.8.Connections, bandwidth, and ports
Connections, bandwidth, and ports
The machine’s own limits still apply to the traffic it sends to your proxy.
- A machine can open 50 new outbound connections each second, with a burst of 200, and hold 1024 open at once. A connection over the limit is dropped, so it times out. A crawler that opens one proxy connection for each request can reach this limit.
- What a machine sends is capped at 50 Mbit/s after a burst. See “Outbound bandwidth” on Limits.
- The free plan drops connections to some TCP ports. Four of them are common proxy ports: 1080, 3128, 3129, and 7777. If a connection to your proxy times out on the free plan, use an endpoint of your provider on another port, such as 8080.
- The proxy must have a public address. A machine cannot reach private addresses such as
10.0.0.0/8or192.168.0.0/16.
What a proxy does not change
What a proxy does not change
A proxy changes the address a site sees. It does not change the browser’s fingerprint, its
cookies, or how fast it clicks, and a site can still block an automated browser for those.
Your provider bills the traffic you send through the proxy, usually by the gigabyte. That includes
the requests Chromium makes on its own, such as its update checks.
Acceptable use
Sending your own traffic out through a proxy is allowed on every plan. Two rules of the Terms still apply:- Respect the sites you visit. Do not use a proxy to break a site’s terms of use, to get around its technical limits, or to scrape personal data.
- Do not turn the machine into a proxy. On the free plan, a machine may not run a proxy or VPN server that carries general internet traffic. On every plan, a machine may not serve as an open proxy or relay for other people.
Computer use
Have a model drive a browser on a machine’s desktop.
Org Secrets
Credentials a machine sees only as placeholders.