11 files changed
+883
-26
No files matched your search
@@ -136,6 +136,27 @@ async fn connect_via_proxy(proxy: &ProxyEndpoint, remote: &RemoteEndpoint) -> Re
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn connect_via_socks5_proxy(
|
||||
proxy_host: &str,
|
||||
proxy_port: u16,
|
||||
proxy_username: &str,
|
||||
proxy_password: &str,
|
||||
remote_host: &str,
|
||||
remote_port: u16,
|
||||
) -> Result<TcpStream, String> {
|
||||
connect_via_proxy(
|
||||
&ProxyEndpoint {
|
||||
proxy_type: ProxyType::Socks5,
|
||||
host: proxy_host.to_string(),
|
||||
port: proxy_port,
|
||||
username: proxy_username.to_string(),
|
||||
password: proxy_password.to_string(),
|
||||
},
|
||||
&RemoteEndpoint { host: remote_host.to_string(), port: remote_port },
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn http_connect(
|
||||
mut stream: TcpStream,
|
||||
proxy: &ProxyEndpoint,
|
||||
|
||||
Reference in new issue
Block a user