> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Bring Your Own Proxy

> Use your own HTTP, HTTPS, or SOCKS5 proxy servers with Anchor Browser sessions.

Anchor Browser lets you use your own proxy servers, giving you complete control over your proxy infrastructure. This is particularly useful when you have existing proxy solutions or need to comply with specific network policies.

## Configuration

To use your own proxy, set `type` to `"custom"` and provide:

* **`active`**: Set to `true` to enable the proxy
* **`type`**: Set to `"custom"` to indicate you're using your own proxy
* **`server`**: The full proxy URL in the format `protocol://hostname:port`
* **`username`**: Your proxy authentication username (if required)
* **`password`**: Your proxy authentication password (if required)

## Supported protocols

Anchor Browser supports the following proxy protocols:

* **HTTP Proxy**: Standard HTTP proxy with optional authentication (e.g., `http://proxy.example.com:8080`)
* **HTTPS Proxy**: Secure HTTPS proxy connections (e.g., `https://proxy.example.com:443`)
* **SOCKS5 Proxy**: SOCKS5 proxy for enhanced privacy and flexibility (e.g., `socks5://proxy.example.com:1080`)

## Examples

<CodeGroup>
  ```javascript node.js theme={null}
  import AnchorBrowser from 'anchorbrowser';

  const anchorClient = new AnchorBrowser({apiKey: process.env.ANCHOR_API_KEY});

  const response = await anchorClient.sessions.create({
    session: {
      proxy: {
        active: true,
        type: 'custom',
        server: 'https://proxy.example.com:443',  // Supported protocols: http, https, socks5
        username: 'myUser',
        password: 'myPassword',
      }
    }
  });
    
  console.log('Session created:', response.data);
  ```

  ```python python theme={null}
  import os
  import json
  from anchorbrowser import Anchorbrowser

  anchor_client = Anchorbrowser(api_key=os.getenv('ANCHOR_API_KEY'))

  response = anchor_client.sessions.create(
    session={
      'proxy': {
          'active': True,
          'type': 'custom',
          'server': 'https://proxy.example.com:443',  # Supported protocols: http, https, socks5
          'username': 'myUser',
          'password': 'myPassword',
      }
    }
  )

  print('Session created:')
  print(response.data)
  ```
</CodeGroup>

For Anchor's built-in proxy with country, region, and city targeting, see [Proxy](/advanced/proxy).
