Skip to content
Fresh 🌱

Custom Proxies ​

Custom proxies allow you to use your own proxy servers with Kernel browsers. This is useful when you have existing proxy infrastructure or specific proxy requirements not covered by Kernel's managed options.

Configuration ​

TIP

HTTP and HTTPS proxies are supported for custom proxy configurations. If no protocol is specified, HTTPS is used by default.

Specify the host, port, and optional authentication credentials for your proxy server:

typescript
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  const proxy = await kernel.proxies.create({
    type: 'custom',
    name: 'my-private-proxy',
    protocol: 'https',
    config: {
      host: 'proxy.example.com',
      port: 443,
      username: 'user123',
      password: 'secure_password',
    },
  });

  const browser = await kernel.browsers.create({
    proxy_id: proxy.id,
  });
python
from kernel import Kernel

kernel = Kernel()

proxy = kernel.proxies.create(
    type="custom",
    name="my-private-proxy",
    protocol="https",
    config={
        "host": "proxy.example.com",
        "port": 443,
        "username": "user123",
        "password": "secure_password",
    }
)

browser = kernel.browsers.create(proxy_id=proxy.id)

Configuration Parameters ​

  • host (required) - Proxy server hostname or IP address
  • port (required) - Proxy server port (1-65535)
  • username - Username for proxy authentication
  • password - Password for proxy authentication (minimum 5 characters)
  • bypass_hosts (optional) - Array of hostnames that bypass the proxy and connect directly (max 100 entries)

INFO

When creating a proxy with authentication, provide the password. The API response will only indicate if a password exists (has_password: true) but won't return the actual password for security reasons.

Bypass hosts ​

Configure specific hostnames to bypass your custom proxy:

typescript
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  const proxy = await kernel.proxies.create({
    type: 'custom',
    name: 'custom-with-bypass',
    protocol: 'https',
    config: {
      host: 'proxy.example.com',
      port: 443,
      username: 'user123',
      password: 'secure_password',
    },
    bypass_hosts: [
      'localhost',
      'internal.service.local',
      '*.trusted-domain.com',
    ],
  });
python
from kernel import Kernel

kernel = Kernel()

proxy = kernel.proxies.create(
    type="custom",
    name="custom-with-bypass",
    protocol="https",
    config={
        "host": "proxy.example.com",
        "port": 443,
        "username": "user123",
        "password": "secure_password",
    },
    bypass_hosts=[
        "localhost",
        "internal.service.local",
        "*.trusted-domain.com",
    ]
)

This is useful for accessing internal services or metadata endpoints without routing through your proxy. See the overview for full bypass host rules.