From 7270aa55507990f9c5ac5ab5e4648bcb126954b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Thu, 15 Aug 2024 19:55:03 +0200 Subject: [PATCH] update readme --- README.md | 21 +++++++++++++++++++++ src/tunnel/transport/io.rs | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 34bdd7f2..262536d7 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,9 @@ Options: 'socks5://[::1]:1212' => listen locally with socks5 on port 1212 and forward dynamically requested tunnel 'socks5://[::1]:1212?login=admin&password=admin' => listen locally with socks5 on port 1212 and only accept connection with login=admin and password=admin + 'http://[::1]:1212' => start a http proxy on port 1212 and forward dynamically requested tunnel + 'http://[::1]:1212?login=admin&password=admin' => start a http proxy on port 1212 and only accept connection with login=admin and password=admin + 'tproxy+tcp://[::1]:1212' => listen locally on tcp on port 1212 as a *transparent proxy* and forward dynamically requested tunnel 'tproxy+udp://[::1]:1212?timeout_sec=10' listen locally on udp on port 1212 as a *transparent proxy* and forward dynamically requested tunnel linux only and requires sudo/CAP_NET_ADMIN @@ -115,6 +118,7 @@ Options: 'tcp://1212:google.com:443' => listen on server for incoming tcp cnx on port 1212 and forward to google.com on port 443 from local machine 'udp://1212:1.1.1.1:53' => listen on server for incoming udp on port 1212 and forward to cloudflare dns 1.1.1.1 on port 53 from local machine 'socks5://[::1]:1212' => listen on server for incoming socks5 request on port 1212 and forward dynamically request from local machine + 'http://[::1]:1212' => listen on server for incoming http proxy request on port 1212 and forward dynamically request from local machine (login/password is supported) 'unix://wstunnel.sock:g.com:443' => listen on server for incoming data from unix socket of path wstunnel.sock and forward to g.com:443 from local machine --no-color @@ -225,7 +229,9 @@ Options: system://0.0.0.0 **WARN** On windows you may want to specify explicitly the DNS resolver to avoid excessive DNS queries +``` +``` SERVER Usage: wstunnel server [OPTIONS] @@ -307,6 +313,21 @@ Options: [Optional] Enables mTLS (client authentication with certificate). Argument must be PEM file containing one or more certificates of CA's of which the certificate of clients needs to be signed with. The ca will be automatically reloaded if it changes + + -p, --http-proxy + If set, will use this http proxy to connect to the client + + [env: HTTP_PROXY=] + + --http-proxy-login + If set, will use this login to connect to the http proxy. Override the one from --http-proxy + + [env: WSTUNNEL_HTTP_PROXY_LOGIN=] + + --http-proxy-password + If set, will use this password to connect to the http proxy. Override the one from --http-proxy + + [env: WSTUNNEL_HTTP_PROXY_PASSWORD=] ``` ## Release diff --git a/src/tunnel/transport/io.rs b/src/tunnel/transport/io.rs index 214b0aad..5dbebe89 100644 --- a/src/tunnel/transport/io.rs +++ b/src/tunnel/transport/io.rs @@ -129,7 +129,7 @@ pub async fn propagate_local_to_remote( biased; read_len = local_rx.read_buf(ws_tx.buf_mut()) => read_len, - + _ = &mut should_close => break, _ = &mut has_pending_operations_pin => { @@ -143,7 +143,7 @@ pub async fn propagate_local_to_remote( } } }, - + _ = timeout.tick(), if ping_frequency.is_some() => { debug!("sending ping to keep connection alive"); ws_tx.ping().await?;