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

# Interceptor

> Intercept and modify requests and responses.

You can access APIs blocked by `Cross-Origin Resource Sharing (CORS)` restriction by using either Auk Agent or custom middleware.

<Tabs>
  <Tab title="Auk Agent">
    ## Auk Agent

    The Auk Agent is a micro application designed to mitigate the challenges posed by `CORS` in modern web browsers. Acting as a local intermediary, it intercepts API requests made through the Auk web app and reroutes them through your local machine. This means that the Auk Agent handles requests using your local network configuration.

    1. Download the Auk Agent for your operating system:

    <AccordionGroup>
      <Accordion title="Mac" icon="apple">
        <Card title="Apple Silicon (.dmg)" href="https://github.com/mamahuhu-io/auk-agent/releases/latest/download/Auk_Agent_mac_aarch64.dmg">
          Download for Apple Silicon-based Mac.
        </Card>

        <Card title="Intel (.dmg)" href="https://github.com/mamahuhu-io/auk-agent/releases/latest/download/Auk_Agent_mac_x64.dmg">
          Download for Intel-based Mac.
        </Card>
      </Accordion>

      <Accordion title="Windows" icon="windows">
        <Card title="Windows Installer (.msi)" href="https://github.com/mamahuhu-io/auk-agent/releases/latest/download/Auk_Agent_win_x64.msi">
          Download the installer for Windows (64-bit).
        </Card>

        <Card title="Windows Portable (.exe)" href="https://github.com/mamahuhu-io/auk-agent/releases/latest/download/Auk_Agent_win_x64_portable.zip">
          Download the portable version for Windows (64-bit).
        </Card>
      </Accordion>

      <Accordion title="Linux" icon="linux">
        <Card title="Debian (.deb)" href="https://github.com/mamahuhu-io/auk-agent/releases/latest/download/Auk_Agent_linux_x64.deb">
          Download the Debian package for Debian-based Linux distributions.
        </Card>

        <Card title="App Image (.AppImage)" href="https://github.com/mamahuhu-io/auk-agent/releases/latest/download/Auk_Agent_linux_x64.AppImage">
          Download the AppImage for Linux.
        </Card>
      </Accordion>
    </AccordionGroup>

    2. Open the Auk app and navigate to the "**Interceptors**" section in **Settings**.
    3. Locate the "**Agent**" option within the Interceptors section to initiate a connection to your local agent.
    4. The application will prompt you for a "**One-Time Verification Code**". This verification code will be generated within the Auk Agent.
    5. Enter the verification code into the application to establish a secure connection.

    Once connected, all API requests made through the Auk web app will be routed through Auk agent, effectively eliminating CORS-related issues.

    <Tip>Recommended interceptor for most users as it is compaitble with all platforms.</Tip>
  </Tab>

  <Tab title="Proxy">
    ## Proxy

    A proxy server acts as an intermediary between your device and the internet, forwarding requests and responses to and from the desired API. By routing requests through a proxy, you can bypass CORS restrictions and access APIs that would otherwise be blocked by the browser.

    * Enable the proxy interceptor from **Settings → Interceptors**.
    * Set the `Proxy URL` to your own proxy middleware endpoint.
    * Make sure your proxy can forward request method, headers, and body correctly.

    ### Configure a custom proxy in Auk

    Once your proxy server is running, configure Auk to use its URL (for example, `http://localhost:9159`) in **Settings → Interceptors → Proxy**.

    This setup routes API requests through your middleware and helps handle APIs with strict CORS policies.
  </Tab>
</Tabs>
