Skip to content

Commit ebb766b

Browse files
fixup
1 parent 4a6139f commit ebb766b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/tor.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ compile_error!("Tor feature can't be used with msvc. Use mingw instead.");
1717
pub struct TorProxy {
1818
/// JoinHandle of the Tor daemon
1919
pub tor_handle: Option<JoinHandle<Result<u8, libtor::Error>>>,
20-
/// Host and port of the SOCKS5 proxy
21-
pub address: String,
20+
/// Host of the SOCKS5 proxy
21+
pub host: String,
2222
/// Socks port used by the Tor daemon
2323
pub socks_port: u16,
2424
/// Data directory used by the Tor daemon
@@ -70,10 +70,9 @@ impl TorProxy {
7070
panic!("Can't find socks_port in logfile");
7171
});
7272

73-
let address = format!("127.0.0.1:{}", socks_port);
7473
TorProxy {
7574
tor_handle,
76-
address,
75+
host: "127.0.0.1".into(),
7776
socks_port,
7877
data_directory,
7978
}

src/transport.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ impl KKTransport {
5656
my_noise_privkey: &SecretKey,
5757
their_noise_pubkey: &PublicKey,
5858
) -> Result<KKTransport, Error> {
59-
let mut stream = socks::Socks5Stream::connect(&proxy.address, addr)?.into_inner();
59+
let mut stream =
60+
socks::Socks5Stream::connect(&format!("{}:{}", proxy.host, proxy.socks_port), addr)?
61+
.into_inner();
6062
let timeout = Duration::from_secs(20);
6163
stream.set_read_timeout(Some(timeout))?;
6264
let channel = KKTransport::perform_client_handshake(

0 commit comments

Comments
 (0)