fetchlet-net 0.1.1

Outbound HTTP, TCP, TLS and WebSocket transports for fetchlet applications
Documentation

fetchlet-net

Outbound HTTP, TCP/TLS socket, and WebSocket transports for fetchlet applications. Each transport pairs with fetchlet's allowlist policies, resolves DNS in Rust, blocks non-public IP addresses by default to prevent SSRF, and speaks TLS with rustls and webpki-roots.

cargo add fetchlet
cargo add fetchlet-net

Quick example

use fetchlet::{FetchPolicy, FetchService, HostServices};
use fetchlet_net::HttpClient;

let policy = FetchPolicy::deny_all().allow_origin("https://api.example.com")?;
let hosts = HostServices::new()
    .outbound(FetchService::new(HttpClient::new(), policy));

Cargo features

Feature Adds
http (default) HttpClient — HTTP/1.1 & HTTP/2 transport for fetch()
sockets (default) TcpTransport — TCP, TLS, and STARTTLS for connect()
websocket (default) WebSocketClient — client transport for global WebSocket

rustls is re-exported for custom TLS configs passed to with_tls_config().

Documentation