#privacy #ohttp #metadata #relay #ohttp-relay

bin+lib ohttp-relay

Relay Oblivious HTTP requests to protect IP metadata

10 releases

0.0.10 Mar 17, 2025
0.0.9 Dec 31, 2024
0.0.8 Mar 27, 2024
0.0.2 Feb 20, 2024

#1028 in Network programming

Download history 178/week @ 2025-01-02 128/week @ 2025-01-09 163/week @ 2025-01-16 109/week @ 2025-01-23 144/week @ 2025-01-30 103/week @ 2025-02-06 146/week @ 2025-02-13 147/week @ 2025-02-20 132/week @ 2025-02-27 142/week @ 2025-03-06 335/week @ 2025-03-13 781/week @ 2025-03-20 496/week @ 2025-03-27 92/week @ 2025-04-03 332/week @ 2025-04-10 168/week @ 2025-04-17

1,344 downloads per month
Used in payjoin-test-utils

MITNFA license

110KB
1.5K SLoC

OHTTP Relay

A rust implementation of an Oblivious HTTP relay resource.

This work is undergoing active revision in the IETF and so are these implementations. Use at your own risk.

Usage

Run ohttp-relay by setting PORT and GATEWAY_ORIGIN environment vaiables. For example, to relay from port 3000 to an OHTTP Gateway Resource at https://payjo.in, run the following.

PORT=3000 GATEWAY_ORIGIN='https://payjo.in' cargo run

Alternatively, set UNIX_SOCKET to bind to a unix socket path instead of a TCP port.

This crate is intended to be run behind a reverse proxy like NGINX that can handle TLS for you. Tests specifically cover this integration using nginx.conf.template.

Bootstrap Feature

The Oblivious HTTP specification requires clients obtain a Key Configuration from the OHTTP Gateway but leaves a mechanism for doing so explicitly unspecified. This feature hosts HTTPS-in-WebSocket and HTTPS-in-CONNECT proxies to allow web clients to GET a gateway's ohttp-keys via Direct Discovery in an end-to-end-encrypted, authenticated manner using the OHTTP relay as a tunnel so as not to reveal their IP address. The bootstrap feature to host these proxies is enabled by default. The ws-bootstrap and connect-bootstrap features enable each proxy individually.

How does it work?

Both bootstrap features enable the server to forward packets directly to and from the OHTTP Gateway's TCP socket to negotiate a TLS session between the client and gateway. By doing so, the OHTTP Relay is prevented from conducting a man-in-the-middle attack to compromise the TLS session.

Dependencies

~12–24MB
~331K SLoC