Skip to content

A Cloudflare Worker that acts as a global edge proxy/gateway for the `agent://` protocol. Resolves a

License

Notifications You must be signed in to change notification settings

Aganium/cloudflare-agent-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Agent Proxy

A Cloudflare Worker that acts as a global edge proxy/gateway for the agent:// protocol. Resolves agent domains via the AGENIUM DNS system and proxies requests to the resolved endpoints.

Features

  • Edge Routingworker-url/agent://name.tld/path → resolved agent endpoint
  • DNS Caching — Cloudflare KV-based cache with TTL from DNS responses
  • Agent Discovery — Fetch agent cards at /discover/name.tld
  • Rate Limiting — Per-IP rate limiting (configurable)
  • CORS — Configurable CORS headers

Endpoints

Route Description
/agent://name.tld/path Proxy request to resolved agent
/resolve/name.tld Resolve domain, return endpoint info
/discover/name.tld Fetch agent card (/.well-known/agent.json)
/health Health check

Setup

1. Install dependencies

npm install

2. Create KV namespace

npx wrangler kv:namespace create AGENT_DNS_CACHE
npx wrangler kv:namespace create AGENT_DNS_CACHE --preview

Update wrangler.toml with the returned namespace IDs.

3. Configure (optional)

Edit wrangler.toml vars:

[vars]
DNS_SERVER = "https://dns.agenium.net"
RATE_LIMIT_PER_MINUTE = "60"
CORS_ORIGINS = "*"

4. Develop locally

npm run dev

5. Deploy

npm run deploy

Usage

# Proxy a request to an agent
curl https://your-worker.workers.dev/agent://weather.agent/forecast?city=london

# Resolve an agent domain
curl https://your-worker.workers.dev/resolve/weather.agent

# Discover agent capabilities
curl https://your-worker.workers.dev/discover/weather.agent

Domain Registration

Supports optional domain registration on the Agenium DNS system using a marketplace API key (dom_<64 hex>). Pass api_key parameter to auto-register your agent on startup. Get your API key from the Telegram Domain Marketplace.

License

MIT

About

A Cloudflare Worker that acts as a global edge proxy/gateway for the `agent://` protocol. Resolves a

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published