third_wheel/
lib.rs

1//! third-wheel is a TLS man-in-the-middle proxy library. Using the crate allows
2//! you to intercept, re-route, modify etc. in-flight HTTP requests and responses
3//! between clients and servers. Client code needs to provide a Layer that
4//! constructs a Service for intercepting requests and responses. `mitm_layer`
5//! provides a convenience function for producing these easily.
6//!
7//! The best way to see how to use this crate is to take a look at the examples.
8
9//Rustc lints
10//<https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>
11#![warn(
12    anonymous_parameters,
13    bare_trait_objects,
14    elided_lifetimes_in_paths,
15    missing_copy_implementations,
16    rust_2018_idioms,
17    single_use_lifetimes,
18    trivial_casts,
19    trivial_numeric_casts,
20    unreachable_pub,
21    unsafe_code,
22    unused_extern_crates,
23    unused_import_braces
24)]
25// Clippy lints
26// <https://rust-lang.github.io/rust-clippy/master/>
27#![warn(
28    clippy::all,
29    clippy::cargo,
30    clippy::dbg_macro,
31    clippy::float_cmp_const,
32    clippy::get_unwrap,
33    clippy::mem_forget,
34    clippy::nursery,
35    clippy::option_unwrap_used,
36    clippy::pedantic,
37    clippy::result_unwrap_used,
38    clippy::todo,
39    clippy::wrong_pub_self_convention
40)]
41
42mod certificates;
43mod proxy;
44
45mod error;
46
47pub use crate::certificates::create_signed_certificate_for_domain;
48pub use crate::certificates::CertificateAuthority;
49pub use error::Error;
50pub use proxy::{
51    mitm::{mitm_layer, ThirdWheel},
52    MitmProxy, MitmProxyBuilder,
53};
54
55pub use hyper;