|
@ -24,8 +24,8 @@ use hyper::server::conn::http1; |
|
|
async fn proxy( |
|
|
async fn proxy( |
|
|
req: Request<hyper::body::Incoming>, |
|
|
req: Request<hyper::body::Incoming>, |
|
|
socks_addr: SocketAddr, |
|
|
socks_addr: SocketAddr, |
|
|
auth: &'static Option<Auth>, |
|
|
auth: Option<&'static Auth>, |
|
|
allowed_domains: &Option<Vec<String>>, |
|
|
allowed_domains: Option<&'static Vec<String>>, |
|
|
) -> Result<Response<BoxBody<Bytes, hyper::Error>>> { |
|
|
) -> Result<Response<BoxBody<Bytes, hyper::Error>>> { |
|
|
let uri = req.uri(); |
|
|
let uri = req.uri(); |
|
|
let method = req.method(); |
|
|
let method = req.method(); |
|
@ -120,7 +120,7 @@ async fn tunnel( |
|
|
upgraded: Upgraded, |
|
|
upgraded: Upgraded, |
|
|
addr: String, |
|
|
addr: String, |
|
|
socks_addr: SocketAddr, |
|
|
socks_addr: SocketAddr, |
|
|
auth: &Option<Auth>, |
|
|
auth: Option<&Auth>, |
|
|
) -> Result<()> { |
|
|
) -> Result<()> { |
|
|
let mut stream = match auth { |
|
|
let mut stream = match auth { |
|
|
Some(auth) => { |
|
|
Some(auth) => { |
|
@ -147,8 +147,8 @@ async fn tunnel( |
|
|
pub async fn proxy_request( |
|
|
pub async fn proxy_request( |
|
|
stream: TcpStream, |
|
|
stream: TcpStream, |
|
|
socks_addr: SocketAddr, |
|
|
socks_addr: SocketAddr, |
|
|
auth_details: &'static Option<Auth>, |
|
|
auth_details: Option<&'static Auth>, |
|
|
allowed_domains: &'static Option<Vec<String>>, |
|
|
allowed_domains: Option<&'static Vec<String>>, |
|
|
) -> color_eyre::Result<()> { |
|
|
) -> color_eyre::Result<()> { |
|
|
let io = TokioIo::new(stream); |
|
|
let io = TokioIo::new(stream); |
|
|
|
|
|
|
|
|