diff --git a/examples/chainproxy.rs b/examples/chainproxy.rs index 3bedab8..d8af01a 100644 --- a/examples/chainproxy.rs +++ b/examples/chainproxy.rs @@ -7,7 +7,7 @@ use tokio::{ net::TcpStream, runtime::Runtime, }; -use tokio_socks::{tcp::Socks5Stream, Error}; +use tokio_socks::{tcp::socks5::Socks5Stream, Error}; const PROXY_ADDR: [&str; 2] = ["184.176.166.20:4145", "90.89.205.248:1080"]; // public proxies found here : http://spys.one/en/socks-proxy-list/ const DEST_ADDR: &str = "duckduckgo.com:80"; diff --git a/src/lib.rs b/src/lib.rs index 34d7704..d53c41d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -261,7 +261,6 @@ impl<'a> Authentication<'a> { mod error; pub mod tcp; -pub mod tcp_socks4; #[cfg(test)] mod tests { diff --git a/src/tcp/mod.rs b/src/tcp/mod.rs new file mode 100644 index 0000000..9a52bbd --- /dev/null +++ b/src/tcp/mod.rs @@ -0,0 +1,2 @@ +pub mod socks4; +pub mod socks5; diff --git a/src/tcp_socks4.rs b/src/tcp/socks4.rs similarity index 100% rename from src/tcp_socks4.rs rename to src/tcp/socks4.rs diff --git a/src/tcp.rs b/src/tcp/socks5.rs similarity index 100% rename from src/tcp.rs rename to src/tcp/socks5.rs diff --git a/tests/common.rs b/tests/common.rs index 8b2e141..6d6c887 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -2,7 +2,6 @@ use once_cell::sync::OnceCell; use std::{ io::{Read, Write}, net::{SocketAddr, TcpStream as StdTcpStream}, - ops::{Deref, DerefMut}, sync::Mutex, }; use tokio::{ @@ -10,11 +9,7 @@ use tokio::{ net::{TcpListener, UnixStream}, runtime::Runtime, }; -use tokio_socks::{ - tcp::{Socks5Listener, Socks5Stream}, - tcp_socks4::{Socks4Listener, Socks4Stream}, - Error, Result, -}; +use tokio_socks::{tcp::socks4::Socks4Listener, tcp::socks5::Socks5Listener, Error, Result}; pub const UNIX_PROXY_ADDR: &'static str = "/tmp/proxy.s"; pub const PROXY_ADDR: &'static str = "127.0.0.1:41080"; diff --git a/tests/long_username_password_auth.rs b/tests/long_username_password_auth.rs index f9bc664..368a2d4 100644 --- a/tests/long_username_password_auth.rs +++ b/tests/long_username_password_auth.rs @@ -2,7 +2,7 @@ mod common; use common::{connect_unix, runtime, test_bind, test_connect, ECHO_SERVER_ADDR, PROXY_ADDR, UNIX_PROXY_ADDR}; use tokio_socks::{ - tcp::{Socks5Listener, Socks5Stream}, + tcp::socks5::{Socks5Listener, Socks5Stream}, Result, }; diff --git a/tests/no_auth.rs b/tests/no_auth.rs index a44560a..cc75a3b 100644 --- a/tests/no_auth.rs +++ b/tests/no_auth.rs @@ -3,7 +3,7 @@ mod common; use crate::common::{runtime, test_bind}; use common::{connect_unix, test_connect, ECHO_SERVER_ADDR, PROXY_ADDR, UNIX_PROXY_ADDR}; use tokio_socks::{ - tcp::{Socks5Listener, Socks5Stream}, + tcp::socks5::{Socks5Listener, Socks5Stream}, Result, }; diff --git a/tests/socks4_no_auth.rs b/tests/socks4_no_auth.rs index 8b03774..891bcda 100644 --- a/tests/socks4_no_auth.rs +++ b/tests/socks4_no_auth.rs @@ -5,7 +5,7 @@ use common::{ connect_unix, test_bind_socks4, test_connect, ECHO_SERVER_ADDR, SOCKS4_PROXY_ADDR, UNIX_SOCKS4_PROXY_ADDR, }; use tokio_socks::{ - tcp_socks4::{Socks4Listener, Socks4Stream}, + tcp::socks4::{Socks4Listener, Socks4Stream}, Result, }; diff --git a/tests/socks4_userid.rs b/tests/socks4_userid.rs index 1e7d1a6..e710de4 100644 --- a/tests/socks4_userid.rs +++ b/tests/socks4_userid.rs @@ -3,7 +3,7 @@ mod common; use common::{ connect_unix, runtime, test_bind_socks4, test_connect, ECHO_SERVER_ADDR, SOCKS4_PROXY_ADDR, UNIX_SOCKS4_PROXY_ADDR, }; -use tokio_socks::{tcp_socks4::*, Result}; +use tokio_socks::{tcp::socks4::*, Result}; #[test] fn connect_userid() -> Result<()> { diff --git a/tests/username_auth.rs b/tests/username_auth.rs index e042d69..7e2bcff 100644 --- a/tests/username_auth.rs +++ b/tests/username_auth.rs @@ -2,7 +2,7 @@ mod common; use common::{connect_unix, runtime, test_bind, test_connect, ECHO_SERVER_ADDR, PROXY_ADDR, UNIX_PROXY_ADDR}; use tokio_socks::{ - tcp::{Socks5Listener, Socks5Stream}, + tcp::socks5::{Socks5Listener, Socks5Stream}, Result, };