Connecting to SOCKS5 Proxy
- Dominant language
- Rust
- Stars
- 583
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
Im trying to connect to IMAP through a SOCKS5 proxy. I'm using the [socks crate](https://crates.io/crates/socks) for this.
I'm getting following error when trying to connect: `unexpected EOF during handshake`
This is what I tried:
```rust
let socks_stream = socks::Socks5Stream::connect(
"127.0.0.1:5000",
format!("{}:{}", imap_server, 993).as_str(),
)
.unwrap();
let client = imap::ClientBuilder::new(imap_server, 993)
.connect(|domain, stream| {
let ssl_conn = tls();
Ok(
native_tls::TlsConnector::connect(&ssl_conn, domain, socks_stream.into_inner())
.unwrap(),
)
})
.expect("Error");
match client.login(email, password).map_err(|e| e.0) {
Ok(imap_session) => Ok(imap_session),
Err(e) => Err(e.to_string()),
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.