Warning
This software is experimental and has not been audited. It is provided as is, and is not eligible for any bounty program. The underlying protocol is defined by the IETF in RFC 9458 and in draft-ietf-ohai-chunked-ohttp-00. Use at your own risk.
A curl-like HTTP/2 and HTTP/3 client for OHTTP, supporting GET and POST requests with TLS.
Currently, pvcli can be installed via cargo:
cargo install --git https://github.com/cloudflareresearch/pvcli
Run pvcli --help to list the available options and subcommands.
Use -v for INFO logs, -vv for DEBUG, and -vvv for TRACE. See -h, --help for more options.
$ cargo run -- https://cloudflare.com/cdn-cgi/trace
h=cloudflare.com
// <snip>
kex=X25519MLKEM768
$ cargo run -- --http3 https://cloudflare.com/cdn-cgi/trace
$ pvcli -vvv --ohttp \
--first-hop https://relay-cloudflare.ohttp.info \
--proxy https://gateway.ohttp.info \
-X POST \
--header "content-type: application/json" \
--data '{"test":1}' \
https://target.ohttp.info/anything
Use -x to proxy requests through an HTTP/2 CONNECT proxy:
$ pvcli -x https://your-proxy.example.com https://target.example.com
You can add custom headers to the proxy request with --proxy-header:
$ pvcli -x https://your-proxy.example.com \
--proxy-header "Proxy-Authorization: Bearer <token>" \
https://target.example.com
npm install wrangler
npx wrangler dev --cwd ./crates/ohttp-gateway-worker
This should build and run the gateway at http://localhost:8787
This tests basic proxying and HPKE encapsulation.
$ pvcli --ohttp -x http://localhost:8787 https://cloudflare.com/cdn-cgi/trace
h=cloudflare.com
// <snip>
kex=X25519MLKEM768
Use --proxy-http3 to send the outer OHTTP request over HTTP/3 instead of HTTP/2:
$ pvcli --ohttp --proxy-http3 -x https://your-h3-gateway https://example.com
This software has not been audited. Please use at your sole discretion. With this in mind, this repository security relies on the following:
- RFC 9458, drafts draft-ietf-ohai-chunked-ohttp-00
- rust dependencies:
hpke,boring,hyper-boring,tokio-quiche, andquiche - cryptography: RFC 9180 (HPKE) and TLS 1.3.
Limitations
- pvcli does not support PQC HPKE (yet!)
- some specification are not yet RFC
This project has the Apache License 2.0.