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

# Proxy Settings

> Route browser traffic through HTTP, HTTPS, or SOCKS5 proxies using the Narada Python SDK

## Overview

The Narada Python SDK allows you to route all browser traffic through a proxy server. This is useful for scenarios such as:

<CardGroup cols={3}>
  <Card title="Privacy & Anonymity" icon="user-secret">
    Mask your IP address and browse anonymously through proxy servers.
  </Card>

  <Card title="Geo-Restrictions" icon="globe">
    Access region-locked content by routing traffic through proxies in different locations.
  </Card>

  <Card title="Corporate Networks" icon="building">
    Work within enterprise environments that require proxy authentication.
  </Card>
</CardGroup>

## Prerequisites

<Note>
  Make sure you have completed the [Getting Started with the SDK](/documentation/getting-started-with-sdk) guide before configuring proxy settings.
</Note>

## Configuration Reference

The `ProxyConfig` class provides all the options you need to configure proxy settings:

<AccordionGroup>
  <Accordion title="server (required)" icon="server" defaultOpen>
    The proxy server URL. Supports HTTP, HTTPS, and SOCKS5 protocols.

    **Formats:**

    * HTTP proxy: `http://proxy.example.com:8080`
    * HTTPS proxy: `https://proxy.example.com:8080`
    * SOCKS5 proxy: `socks5://proxy.example.com:1080`

    ```python theme={null}
    proxy = ProxyConfig(server="http://proxy.example.com:8080")
    ```
  </Accordion>

  <Accordion title="username" icon="user">
    Optional username for proxy authentication. Must be provided together with `password`.

    ```python theme={null}
    proxy = ProxyConfig(
        server="http://proxy.example.com:8080",
        username="your_username",
        password="your_password"
    )
    ```
  </Accordion>

  <Accordion title="password" icon="key">
    Optional password for proxy authentication. Must be provided together with `username`.

    <Warning>
      Never hardcode credentials in your source code. Use environment variables or a secrets manager instead.
    </Warning>
  </Accordion>

  <Accordion title="bypass" icon="route">
    Optional comma-separated list of domains that should bypass the proxy.

    ```python theme={null}
    proxy = ProxyConfig(
        server="http://proxy.example.com:8080",
        bypass=".example.com, internal.corp, localhost"
    )
    ```

    <Tip>
      Use a leading dot (`.example.com`) to match all subdomains of a domain.
    </Tip>
  </Accordion>

  <Accordion title="ignore_cert_errors" icon="shield-halved">
    Set to `True` to ignore SSL certificate errors. Required for proxies that perform HTTPS inspection (MITM).

    <Danger>
      Only enable this option if you trust your proxy server completely. Disabling certificate verification exposes your traffic to potential interception.
    </Danger>

    ```python theme={null}
    proxy = ProxyConfig(
        server="http://corporate-proxy.example.com:8080",
        ignore_cert_errors=True  # Use with caution!
    )
    ```
  </Accordion>
</AccordionGroup>

## Quick Start

<Steps>
  <Step title="Import the Required Classes">
    Import `ProxyConfig` and `BrowserConfig` from the Narada SDK:

    ```python theme={null}
    from narada import Agent, BrowserConfig, BrowserEnvironment, ProxyConfig
    ```
  </Step>

  <Step title="Create a Proxy Configuration">
    Define your proxy settings using `ProxyConfig`:

    ```python theme={null}
    proxy = ProxyConfig(
        server="http://proxy.example.com:8080",
        username="your_username",  # optional
        password="your_password",  # optional
    )
    ```
  </Step>

  <Step title="Apply Proxy to Browser Configuration">
    Pass the proxy configuration to `BrowserConfig`:

    ```python theme={null}
    config = BrowserConfig(proxy=proxy)
    ```
  </Step>

  <Step title="Launch Browser with Proxy">
    Use the configuration when creating a browser environment:

    ```python theme={null}
    config = BrowserConfig(proxy=proxy)
    env = BrowserEnvironment(config=config)
    agent = Agent(environment=env)

    try:
        response = await agent.run(
            prompt="Go to https://httpbin.org/ip and tell me what IP address is shown.",
        )
        print(response.text)
    finally:
        await env.close()
    ```

    <Check>
      Your browser window is now configured to route all traffic through the proxy server.
    </Check>
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="SSL certificate errors">
    If you're seeing SSL/TLS certificate errors:

    1. **Corporate proxy** - Your proxy may be performing HTTPS inspection (MITM)
    2. **Enable ignore\_cert\_errors** - Set `ignore_cert_errors=True` if you trust the proxy
    3. **Install CA certificate** - Alternatively, install your organization's CA certificate

    <Warning>
      Only use `ignore_cert_errors=True` with trusted proxies in controlled environments.
    </Warning>
  </Accordion>
</AccordionGroup>
