From 66419b4aad6585f666a0ce4c92b96a2be4c8f168 Mon Sep 17 00:00:00 2001 From: rustaceanrob Date: Thu, 9 Apr 2026 19:43:12 +0100 Subject: [PATCH] Add standard `new` method to `Socks5Proxy` --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 2af34ffe..dea59aa9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -306,6 +306,11 @@ impl From for TrustedPeer { pub struct Socks5Proxy(SocketAddr); impl Socks5Proxy { + /// Define a non-standard Socks5 proxy to connect to. + pub fn new(socket_addr: impl Into) -> Self { + Self(socket_addr.into()) + } + /// Connect to the default local Socks5 proxy hosted at `127.0.0.1:9050`. pub const fn local() -> Self { Socks5Proxy(SocketAddr::new(