electrum: add rustls as the default ssl implementation

This commit is contained in:
Alekos Filini
2020-02-06 17:04:59 +01:00
parent f5a201b98d
commit c4dc741310
7 changed files with 153 additions and 16 deletions

View File

@@ -0,0 +1,9 @@
extern crate electrum_client;
use electrum_client::Client;
fn main() {
let mut client = Client::new("kirsche.emzy.de:50001").unwrap();
let res = client.server_features();
println!("{:#?}", res);
}

View File

@@ -0,0 +1,13 @@
extern crate electrum_client;
use electrum_client::Client;
fn main() {
let mut client = Client::new_ssl(
"electrum2.hodlister.co:50002",
Some("electrum2.hodlister.co"),
)
.unwrap();
let res = client.server_features();
println!("{:#?}", res);
}

View File

@@ -0,0 +1,21 @@
extern crate electrum_client;
use electrum_client::Client;
fn main() {
// NOTE: This assumes Tor is running localy, with an unauthenticated Socks5 listening at
// localhost:9050
let mut client = Client::new_proxy("ozahtqwp25chjdjd.onion:50001", "127.0.0.1:9050").unwrap();
let res = client.server_features();
println!("{:#?}", res);
// works both with onion v2/v3 (if your Tor supports them)
let mut client = Client::new_proxy(
"v7gtzf7nua6hdmb2wtqaqioqmesdb4xrlly4zwr7bvayxv2bpg665pqd.onion:50001",
"127.0.0.1:9050",
)
.unwrap();
let res = client.server_features();
println!("{:#?}", res);
}