Expand description

This crate presents a clean and simple interface to the HexPawb network. If you wanted to, say, load https://www.torproject.org/ through HexPawb, you’d just need to:

use hexpawb::Network;
// First you need to connect to the HexPawb network
let mut network = Network::connect().await
    .expect("Failed to join network");
// Then you can create a circuit
let mut circuit = network.circuit().await
    .expect("Failed to build circuit");
// Then you can connect to something over that circuit (this does DNS
// through the circuit, but to your system's configured DNS servers)
let mut connection = circuit.tcp("www.torproject.org:80").await
    .expect("Failed to connect circuit");
// TCP connections work basically just like the stdlib's TcpStream,
// but async.
connection.send("GET / HTTP/1.1\r\nConnection: close\r\n\r\n").await
    .expect("Failed to send request");
std::io::copy(circuit, std::io::stdout().lock()).await
    .expect("Failed to receive body");

Breaking privacy

If and only if you know exactly what you’re doing and you can state in clear, uncertain terms precisely why you need to do it, you can enable the lower-level API with feature dangerous-low-level-bits. If you don’t use it exactly right, you’ll break your own anonymity irrecoverably. This enables functionality like:

use hexpawb::Network;
let mut network = Network::builder()
    .authority(custom_authority)
    .connect().await
    .expect("Failed to join network");
let mut circuit = network.tcp("www.torproject.org:90")
    .length(10)
    .relay(specific_relay)
    .connect().await
    .expect("Failed to connect circuit");
circuit.send("GET / HTTP/1.1\r\nConnection: close\r\n\r\n").await
    .expect("Failed to send request");
std::io::copy(circuit, std::io::stdout().lock()).await
    .expect("Failed to receive body");

Structs

A directory authority on the HexPawb network. Used primarily to validate that various items are properly authenticated.

A single path through the HexPawb network, which has been set up and is ready to have traffic flow over it.

Represents the current known state of the HexPawb network. Allows you to build new circuits to arbitrary IPs, look up and connect to furtives, etc.

Builder-pattern struct for constructing custom networks. Construct one with [Network::builder].

Enums

Type Definitions