Skip to content
🎯 New workshop: Govern AI Costs in Real Time — Hands-On with agentgateway agentgateway has joined the Agentic AI FoundationLearn more

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Page as Markdown

Non-agentic HTTP traffic

Verified Code examples on this page have been automatically tested and verified.

Route HTTP traffic to a non-agentic backend such as httpbin with the agentgateway binary.

Use the agentgateway binary to route HTTP traffic to a simple backend (httpbin) running locally.

    flowchart LR
    A[client] -->|localhost:3000| B[agentgateway]
    B --> C[httpbin]
  
  1. The client sends requests to agentgateway on port 3000.
  2. Agentgateway forwards the requests to the httpbin backend based on the route and backend configuration.
  3. Httpbin responds, and agentgateway returns the response back to the client.

Before you begin

  1. Install the agentgateway binary.

    curl -sL https://agentgateway.dev/install | bash
  2. Install Docker to run httpbin.

Steps

Step 1: Start httpbin in Docker

Run the httpbin image so it listens on port 80 inside the container. Map it to a host port such as 8000 so that agentgateway can reach it.

docker run --rm -d -p 8000:80 --name httpbin kennethreitz/httpbin

Verify that httpbin responds.

curl -s http://localhost:8000/headers | head -20 || true

Example output:

{
  "headers": {
    "Accept": "*/*",
    "Host": "localhost:8000",
    "User-Agent": "curl/8.7.1"
  }
}

Step 2: Configure agentgateway to route to httpbin

You add the listener and route from the UI, so you can start agentgateway with an empty config file.

  1. In a separate terminal, start agentgateway.

    echo '{}' > config.yaml
    agentgateway -f config.yaml
  2. Open the agentgateway UI. On the Gateway Overview, find the Traffic row and click Enable Traffic.

  3. Add a bind and listener.

    1. In the Traffic section of the navigation menu, click Listeners.
    2. Click Add bind, enter 3000 for the Port, and click Save bind.
    3. Click Add listener, keep the defaults (HTTP, hostname *), and save the listener.
  4. Add a route to httpbin.

    1. Click Routes, and then click Add route.
    2. For the Listener, select the :3000 listener you created.
    3. Under Backends, click Add backend, keep the Host target type, and enter 127.0.0.1:8000 for the host.
    4. Click Save route.

Step 3: Send a request through agentgateway

Send a request to agentgateway on port 3000. Agentgateway forwards it to httpbin; the response is returned to you.

curl -i http://localhost:3000/headers

Example response (status and headers):

HTTP/1.1 200 OK
content-type: application/json
...

Example JSON body:

{
  "headers": {
    "Accept": "*/*",
    "Host": "localhost:3000",
    "User-Agent": "curl/8.7.1"
  }
}

You can try other httpbin endpoints through agentgateway, such as the following.

curl -s http://localhost:3000/get
curl -s http://localhost:3000/post -X POST -H "Content-Type: application/json" -d '{"key":"value"}'

Step 4 (Optional): Stop httpbin

When you are done, stop and remove the httpbin container.

docker stop httpbin
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.