Connector Proxy¶
A connector-proxy is an optional application that can be deployed alongside (or separately from) the frontend and backend. Please see Connector Proxy in 5 mins.
Connector proxies are containers for connectors. In this repository, connectors are Python libraries that are included in connector proxy codebases, and some proxies embed connector logic directly (see the async-http example below). Our connector-proxy-demo includes a few connectors, including connector-aws, connector-http, connector-slack, and connector-smtp. Connector-http can be used for many API interactions, but you can also write your own connectors.
The connector proxy protocol defines discovery, execution, response envelopes, errors, and asynchronous callbacks. This page describes the architecture and the async HTTP example.
async-http Example¶
The async-http example demonstrates a simple and explicit connector proxy pattern:
A command discovery endpoint that returns available commands and parameter schemas
A set of execution routes, one per command
A consistent response envelope for results, with a versioned contract
Implementation notes:
Built with Falcon ASGI (
falcon.asgi.App)Uses httpx.AsyncClient for outbound requests (
timeout=Nonein the sample)Uses orjson for JSON parsing
Enables CORS (
cors_enable=True)
Important: This implementation is intentionally minimal (for example, error handling is marked TODO) and should be hardened before production use. See Security & Production Hardening.
Running async-http with Docker Compose¶
Example compose service:
services:
connector-proxy-async-http:
build:
context: connector-proxies/async-http
dockerfile: Dockerfile
environment:
HOST: "0.0.0.0"
PORT: "${CONNECTOR_PROXY_ASYNC_HTTP_PORT:-8200}"
XDG_CACHE_HOME: "/app/.cache"
ports:
- "${CONNECTOR_PROXY_ASYNC_HTTP_PORT:-8200}:${CONNECTOR_PROXY_ASYNC_HTTP_PORT:-8200}/tcp"
Start the service:
docker compose up --build
By default, the port published is:
http://localhost:8200(whenCONNECTOR_PROXY_ASYNC_HTTP_PORTis not set)
API: Command Discovery¶
GET /v1/commands¶
The protocol reference defines the discovery response. The async-http example exposes these commands:
http/DeleteRequesthttp/GetRequesthttp/HeadRequesthttp/PatchRequesthttp/PostRequesthttp/PutRequest
API: Command Execution¶
The async-http example exposes these execution routes:
POST /v1/do/http/DeleteRequestPOST /v1/do/http/GetRequestPOST /v1/do/http/HeadRequestPOST /v1/do/http/PatchRequestPOST /v1/do/http/PostRequestPOST /v1/do/http/PutRequest
Each route accepts JSON, makes an outbound request with
httpx.AsyncClient.request(...), and returns the
version 2 response envelope.
Parameters (/v1/commands)¶
The async-http discovery response advertises these parameters.
Common parameters (all commands)¶
url(required, string) — Target URLheaders(optional, any/object) — Request headers
Optional basic authentication (supported)¶
basic_auth_username(optional, string)basic_auth_password(optional, string)
GET / HEAD commands¶
params(optional, any/object) — Query string parameters
DELETE / PATCH / POST / PUT commands¶
data(optional, any/object) — request body.body_format(optional, string) — how to senddata; defaults tojson. Supported values arejson,form,raw, andnone.include_response_headers(optional, boolean) — when true, include upstream response headers incommand_response.headers.
Note: In this example,
DeleteRequestis advertised withdata(notparams) in the command schema.
The embedded Arena HTTP connector also supports body_format and include_response_headers on its standard write commands.
Request and Response Examples¶
See Connector Proxy API Examples for HTTP command requests, response parsing, errors, and long-running task callbacks.
Error Handling Notes¶
The async-http example is intentionally minimal:
erroris included but may not be populated in all casesthe HTTP client is configured with
timeout=None
For production use, implement:
consistent error objects in
errorexception handling for upstream failures and parsing errors
timeouts and retry policies appropriate for your environment
API Key Authentication¶
See the protocol’s transport security section for API-key behavior and Configure a Connector Proxy for deployment configuration.