Skip to content

Commit 511e94a

Browse files
authored
Merge pull request #562 from rustaceanrob/26-4-9-socks
Add standard `new` method to `Socks5Proxy`
2 parents 6348e93 + 66419b4 commit 511e94a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ impl From<SocketAddr> for TrustedPeer {
306306
pub struct Socks5Proxy(SocketAddr);
307307

308308
impl Socks5Proxy {
309+
/// Define a non-standard Socks5 proxy to connect to.
310+
pub fn new(socket_addr: impl Into<SocketAddr>) -> Self {
311+
Self(socket_addr.into())
312+
}
313+
309314
/// Connect to the default local Socks5 proxy hosted at `127.0.0.1:9050`.
310315
pub const fn local() -> Self {
311316
Socks5Proxy(SocketAddr::new(

0 commit comments

Comments
 (0)