API to API (unicomm proxy)
In v0.1.2 one command, unicomm proxy, covers both directions: a port or http://host:port wraps a local service in PQ TLS, an https:// URL gives a plain local app access to a PQ API.
unicomm proxy 8080 --policy pq-required # wrap local port 8080 in PQ TLS (listens on 0.0.0.0:8443)unicomm proxy https://api.example:8446 --listen 127.0.0.1:9000 # a plain local port that reaches a PQ APIA number or http://host:port target wraps a local service (the serve flags below). An https:// target connects to a remote API (the connect flags below). For raw TCP add --tcp; add --connect to treat the target as the remote.
Two small proxies cover the common case where you cannot touch the application code:
unicomm proxy <port>(aliasserve) is a TLS-terminating reverse proxy. It listens with a UniComm policy and forwards to a plain-HTTP upstream (or, with--tcp, any TCP service).unicomm proxy https://...(aliasconnect) is the other end: a local plain-HTTP listener that reaches a remote HTTPS API over the chosen policy (or, with--tcp, TLS-wraps a raw stream).
legacy client --http--> unicomm proxy https://.. ==PQ TLS==> unicomm proxy 8080 --http--> legacy API (loopback) 127.0.0.1:9000 0.0.0.0:8443 127.0.0.1:8080Wrap a port (proxy <port>, alias serve)
Section titled “Wrap a port (proxy <port>, alias serve)”unicomm proxy http://127.0.0.1:8080 --listen 0.0.0.0:8443 --policy pq-required \ --cert fullchain.pem --key key.pem| Flag | Meaning |
|---|---|
| target (required) | a port, or plain upstream http://127.0.0.1:8080; with --tcp a host:port (alias serve takes it as --upstream) |
--listen |
TLS listen address, default 0.0.0.0:8443 |
--policy |
hybrid (default), pq-required, cnsa2 |
--cert / --key |
certificate chain and key; without them the local dev PKI in --cert-dir (default certs) |
--client-ca |
mTLS: require a client certificate signed by a CA in this PEM file |
--http3 |
also listen for HTTP/3 on the same port number over UDP (not with --tcp or cnsa2) |
--tcp |
TLS-terminate a raw TCP service instead of HTTP |
--metrics-path |
serve Prometheus counters at this path, for example /_unicomm/metrics |
Reach a remote API (proxy https://..., alias connect)
Section titled “Reach a remote API (proxy https://..., alias connect)”unicomm proxy https://api.example:8446 --listen 127.0.0.1:9000 --policy pq-required --cacert ca.pemcurl http://127.0.0.1:9000/health # your legacy client talks plain HTTP to the local proxyFlags: --listen (default 127.0.0.1:9000), the target (--to for the connect alias), --policy (hybrid default, also pq-required, cnsa2, classical), --cacert (trust only
this CA), --cert / --key (mTLS client identity), --server-name, --tcp.
Limits stated in the source
Section titled “Limits stated in the source”- The leg between the proxy and the plain side is not encrypted. Keep it on loopback or a private network.
- The proxy opens a new connection to the plain side for every request (no pooling).
- HTTP/1.1 and HTTP/2, WebSocket upgrade passthrough and streaming bodies are handled; the tests for them were not part of this docs work.
- This conflicts with ADR-0010 (no plaintext hop) unless the plain leg stays on one host. That is a known gap, listed under Security and limits.