fetchlet_net/lib.rs
1//! Outbound network transports for fetchlet applications.
2//!
3//! The `http` feature adds [`HttpClient`], which sends JavaScript's outbound
4//! `fetch` requests as a `FetchTransport`; the `sockets` feature adds
5//! [`TcpTransport`], which opens the TCP and TLS connections of JavaScript's
6//! `connect()` for a `SocketService`; and the `websocket` feature adds
7//! [`WebSocketClient`], which opens the connections of JavaScript's
8//! `WebSocket` for a `WebSocketService`. Each resolves names, refuses
9//! non-public addresses unless allowed and speaks TLS with rustls.
10//! The JavaScript engine is chosen on the `fetchlet` crate.
11
12#[cfg(feature = "http")]
13mod http;
14#[cfg(any(feature = "http", feature = "sockets", feature = "websocket"))]
15mod network;
16#[cfg(feature = "sockets")]
17mod socket;
18#[cfg(feature = "websocket")]
19mod websocket;
20
21#[cfg(feature = "http")]
22pub use http::HttpClient;
23#[cfg(any(feature = "http", feature = "sockets", feature = "websocket"))]
24pub use network::rustls;
25#[cfg(feature = "sockets")]
26pub use socket::TcpTransport;
27#[cfg(feature = "websocket")]
28pub use websocket::WebSocketClient;