From 8fc281d7b75849147aaa3b689f2579b251283177 Mon Sep 17 00:00:00 2001 From: hatoo Date: Mon, 24 Feb 2025 20:08:33 +0900 Subject: [PATCH] Use re-exported crates --- README.md | 4 +--- examples/dev_proxy.rs | 8 +++++--- examples/https.rs | 4 +--- examples/proxy.rs | 4 +--- examples/reqwest_proxy.rs | 8 +++++--- examples/websocket.rs | 7 ++++--- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index bf35689..b652c6d 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,7 @@ A HTTP proxy server library intended to be a backend of application like Burp pr use std::path::PathBuf; use clap::{Args, Parser}; -use http_mitm_proxy::{DefaultClient, MitmProxy}; -use hyper::service::service_fn; -use moka::sync::Cache; +use http_mitm_proxy::{hyper::service::service_fn, moka::sync::Cache, DefaultClient, MitmProxy}; use tracing_subscriber::EnvFilter; #[derive(Parser)] diff --git a/examples/dev_proxy.rs b/examples/dev_proxy.rs index 32f9963..0a1f6a9 100644 --- a/examples/dev_proxy.rs +++ b/examples/dev_proxy.rs @@ -4,9 +4,11 @@ use axum::{routing::get, Router}; use bytes::Bytes; use clap::{Args, Parser}; use http_body_util::{BodyExt, Full}; -use http_mitm_proxy::{DefaultClient, MitmProxy}; -use hyper::{service::service_fn, Response}; -use moka::sync::Cache; +use http_mitm_proxy::{ + hyper::{service::service_fn, Response}, + moka::sync::Cache, + DefaultClient, MitmProxy, +}; #[derive(Parser)] struct Opt { diff --git a/examples/https.rs b/examples/https.rs index a1b67c1..46b6273 100644 --- a/examples/https.rs +++ b/examples/https.rs @@ -1,10 +1,8 @@ use std::{path::PathBuf, sync::Arc}; use clap::{Args, Parser}; -use http_mitm_proxy::{DefaultClient, MitmProxy}; -use hyper::service::service_fn; +use http_mitm_proxy::{hyper::service::service_fn, moka::sync::Cache, DefaultClient, MitmProxy}; use hyper_util::rt::{TokioExecutor, TokioIo}; -use moka::sync::Cache; use tokio::net::TcpListener; use tokio_rustls::{ rustls::{self, pki_types::PrivatePkcs8KeyDer, ServerConfig}, diff --git a/examples/proxy.rs b/examples/proxy.rs index 000f2ce..9dea86e 100644 --- a/examples/proxy.rs +++ b/examples/proxy.rs @@ -1,9 +1,7 @@ use std::path::PathBuf; use clap::{Args, Parser}; -use http_mitm_proxy::{DefaultClient, MitmProxy}; -use hyper::service::service_fn; -use moka::sync::Cache; +use http_mitm_proxy::{hyper::service::service_fn, moka::sync::Cache, DefaultClient, MitmProxy}; use tracing_subscriber::EnvFilter; #[derive(Parser)] diff --git a/examples/reqwest_proxy.rs b/examples/reqwest_proxy.rs index 93d1161..6272e02 100644 --- a/examples/reqwest_proxy.rs +++ b/examples/reqwest_proxy.rs @@ -3,9 +3,11 @@ use std::path::PathBuf; use bytes::Bytes; use clap::{Args, Parser}; -use http_mitm_proxy::MitmProxy; -use hyper::{body::Body, service::service_fn}; -use moka::sync::Cache; +use http_mitm_proxy::{ + hyper::{body::Body, service::service_fn}, + moka::sync::Cache, + MitmProxy, +}; use tracing_subscriber::EnvFilter; #[derive(Parser)] diff --git a/examples/websocket.rs b/examples/websocket.rs index b9b543a..edd2cfa 100644 --- a/examples/websocket.rs +++ b/examples/websocket.rs @@ -1,9 +1,10 @@ use std::path::PathBuf; use clap::{Args, Parser}; -use http_mitm_proxy::{default_client::Upgraded, DefaultClient, MitmProxy}; -use hyper::service::service_fn; -use moka::sync::Cache; +use http_mitm_proxy::{ + default_client::Upgraded, hyper::service::service_fn, moka::sync::Cache, DefaultClient, + MitmProxy, +}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tracing_subscriber::EnvFilter; use winnow::Parser as _;