Skip to main content

Module gateway_fwd

Module gateway_fwd 

Source
Expand description

agentmux-mcp gateway-fwd: the gateway forwarder srv runs as a helper container on the agents network (Docker Desktop), so a container agent’s model-gateway request carries proof of which container it is from (agentmux_common::gateway_stamp; srv’s side is container::gateway_fwd).

It accepts a request only on the gateway’s own paths, removes every x-amx-fwd-* header the client sent, adds the address the connection came from, the time and a proof made with the secret srv gave it, and streams the request and the answer through unbuffered. It reads no token and holds no key: the agent’s gateway token goes through untouched and srv decides on it. Its secret comes from the environment at start and is removed from it; it is never printed.

Structs§

Forwarder 🔒

Constants§

DEFAULT_PORT 🔒
ENV_PORT 🔒
ENV_SECRET 🔒
ENV_UPSTREAM 🔒
HOP_BY_HOP 🔒
Headers that describe one hop of a connection, not the request or answer, so they are not passed on.

Functions§

app 🔒
client 🔒
forward 🔒
plain 🔒
run
Serves until the process ends. Returns the exit code.
upstream_headers 🔒
The headers to send srv: the client’s own, less the hop’s and every stamp header it set, plus this hop’s stamp.