fix(rocketmq): route tunneled traffic through SOCKS5

Closes #5742
This commit is contained in:
t8y2 committed 2026-08-11 03:16:08 +08:00
1 parent 2e9ed477a4
commit 5351fc5066
11 files changed
+883 -26

No files matched your search

+21
View File
@@ -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,