ohttp

Oblivious HTTP for OCaml. ohttp implements RFC 9458, which lets a client send an HTTP request through a relay so that no single party sees both who is asking and what is asked. bhttp implements the message format that it carries, Binary HTTP (RFC 9292), and is a package of its own.

Neither is an HTTP library, and neither depends on one. An encapsulated message is a string, and any HTTP library can post it. Adapter packages carry the messages over cohttp-lwt, cohttp-eio, and Piaf, as a client, a relay, and a gateway.

Try it

You need OCaml 4.14 or later and an active opam switch:

git clone https://github.com/thevilledev/ocaml-ohttp.git
cd ocaml-ohttp
opam install . --deps-only
opam exec -- dune exec examples/basic.exe

The example runs one exchange between a client and a gateway:

gateway received GET https://example.com/hello
client received 200: hello from the target

With cohttp-lwt-unix installed, opam exec -- dune build @e2e runs a client, a relay, a gateway, and a target over real HTTP on your machine, through the ohttp-cohttp-lwt adapter. Read the example source and the getting started guide to use the libraries in your own project.

What it provides

Applications authenticate key configurations, limit the rate of requests, and decide which requests to check for replay. See protocol support for the exact feature set and known gaps.

Documentation

I want to…

Start here

Install the libraries and understand the example

Getting started

Use them with cohttp, Piaf, or another HTTP library

HTTP libraries

Check supported features and algorithms

Protocol support

See how other implementations compare

Interoperability

Build, test, or find a module

Development guide

Prepare an opam release

Release checklist

Review limitations or report a vulnerability

Security

See what changed

Changelog

License

ISC.