Proxies

View as Markdown

Browser runtimes can route traffic through a proxy. Use proxies for geo-specific workflows, IP isolation, or sites that require stable network identity.

Use a saved proxy

Create and test proxies once, then reference them when launching runtimes.

1const proxy = await bctrl.proxies.create({
2 kind: "managed-rotating",
3 name: "us-residential",
4 defaults: {
5 protocol: "http",
6 geo: { country: "US" },
7 affinity: { strategy: "sticky", key: "acme-invoices" },
8 },
9});
10
11const runtime = await space.runtimes.browser.launch({
12 name: "crm",
13 config: {
14 proxy: {
15 mode: "saved",
16 id: proxy.id,
17 },
18 },
19});

Use a custom proxy

1const runtime = await space.runtimes.browser.launch({
2 name: "customer-proxy",
3 config: {
4 proxy: {
5 mode: "custom",
6 protocol: "http",
7 host: "proxy.example.com",
8 port: 8080,
9 username: "user",
10 password: process.env.PROXY_PASSWORD!,
11 },
12 },
13});

Test before launch

1const result = await bctrl.proxies.test(proxy.id);
2
3if (!result.ok) {
4 throw new Error(result.message);
5}