Skip to content

Making requests

bytetourist is a standard forward proxy. Anything that speaks the HTTP proxy protocol can use it without an SDK.

curl -x http://dev.bytetourist.com:8080 \
-U "YOUR_API_KEY:" \
http://httpbin.org/headers

HTTPS targets are tunnelled with CONNECT. bytetourist terminates your TLS at the proxy with a certificate it signs itself for that host (MITM), so it can route each request inside the tunnel; the node then opens its own TLS connection to the site with a browser-grade fingerprint (see Anti-bot & TLS fingerprints). Your client has to accept the proxy’s certificate: use -k (or your client’s equivalent), or trust the bytetourist CA:

curl -k -x http://dev.bytetourist.com:8080 \
-U "YOUR_API_KEY-cc-de:" \
https://example.com
import requests
# Keep the ':' after the key: without it, requests sends no credentials.
proxy = "http://YOUR_API_KEY-cc-de:@dev.bytetourist.com:8080"
r = requests.get(
"https://api.ipify.org?format=json",
proxies={"http": proxy, "https": proxy},
# The proxy re-signs HTTPS (or point verify= at the bytetourist CA).
verify=False,
timeout=35,
)
print(r.json())
import { fetch, ProxyAgent } from 'undici';
const dispatcher = new ProxyAgent({
uri: 'http://dev.bytetourist.com:8080',
token: `Basic ${Buffer.from('YOUR_API_KEY-cc-de:').toString('base64')}`,
// The proxy re-signs HTTPS (or trust the bytetourist CA).
requestTls: { rejectUnauthorized: false },
});
const res = await fetch('https://example.com', { dispatcher });
console.log(res.status);

Each request gets a fixed timeout (a system-wide setting, currently 30 seconds) for the node’s whole call to the target. If no response has started by then you get 598 with X-Proxy-Error: upstream_timeout; a response still streaming when it runs out is cut off. bytetourist doesn’t retry for you; retry on your side (see Reliability & retries).

The node forwards your request method, path, headers and body to the target, minus Proxy-Authorization and the X-Proxy-* headers bytetourist reads (stripped before the request reaches the node). Routing headers sent inside an HTTPS tunnel aren’t read, so they go through to the site. By default the node also presents a browser profile whose own headers (User-Agent, Accept, Accept-Language and similar) replace yours. Send X-Proxy-Stealth: off to keep yours. The response’s status, headers, and body stream back to you (the body decompressed, then gzip-encoded if your client accepts it); the node’s latency and bytes transferred are recorded for routing and analytics.