> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-hypeship-document-audit-logs-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.
</Tip>

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

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  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 Python theme={null}
  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)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"

  	"github.com/kernel/kernel-go-sdk"
  )

  func main() {
  	ctx := context.Background()
  	client := kernel.NewClient()

  	proxy, err := client.Proxies.New(ctx, kernel.ProxyNewParams{
  		Type:     kernel.ProxyNewParamsTypeCustom,
  		Name:     kernel.String("my-private-proxy"),
  		Protocol: kernel.ProxyNewParamsProtocolHTTPS,
  		Config: kernel.ProxyNewParamsConfigUnion{
  			OfProxyNewsConfigCreateCustomProxyConfig: &kernel.ProxyNewParamsConfigCreateCustomProxyConfig{
  				Host:     "proxy.example.com",
  				Port:     443,
  				Username: kernel.String("user123"),
  				Password: kernel.String("secure_password"),
  			},
  		},
  	})
  	if err != nil {
  		panic(err)
  	}

  	browser, err := client.Browsers.New(ctx, kernel.BrowserNewParams{
  		ProxyID: kernel.String(proxy.ID),
  	})
  	if err != nil {
  		panic(err)
  	}
  	_ = browser
  }
  ```
</CodeGroup>

## 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.
</Info>

## Bypass hosts

Configure specific hostnames to bypass your custom proxy:

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  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 Python theme={null}
  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",
      ]
  )
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"

  	"github.com/kernel/kernel-go-sdk"
  )

  func main() {
  	ctx := context.Background()
  	client := kernel.NewClient()

  	proxy, err := client.Proxies.New(ctx, kernel.ProxyNewParams{
  		Type:     kernel.ProxyNewParamsTypeCustom,
  		Name:     kernel.String("custom-with-bypass"),
  		Protocol: kernel.ProxyNewParamsProtocolHTTPS,
  		Config: kernel.ProxyNewParamsConfigUnion{
  			OfProxyNewsConfigCreateCustomProxyConfig: &kernel.ProxyNewParamsConfigCreateCustomProxyConfig{
  				Host:     "proxy.example.com",
  				Port:     443,
  				Username: kernel.String("user123"),
  				Password: kernel.String("secure_password"),
  			},
  		},
  		BypassHosts: []string{
  			"localhost",
  			"internal.service.local",
  			"*.trusted-domain.com",
  		},
  	})
  	if err != nil {
  		panic(err)
  	}
  	_ = proxy
  }
  ```
</CodeGroup>

This is useful for accessing internal services or metadata endpoints without routing through your proxy. See the [overview](/proxies/overview#bypass-hosts) for full bypass host rules.
