Use proxy's DNS in TOR example (#1003)

Fix #899
This commit is contained in:
Scott Dupree
2020-08-17 14:02:09 -04:00
committed by GitHub
parent 7a5c5ed600
commit 512fb97ffc

View File

@@ -6,7 +6,7 @@
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
// Make sure you are running tor and this is your socks port
let proxy = reqwest::Proxy::all("socks5://127.0.0.1:9050").expect("tor proxy should be there");
let proxy = reqwest::Proxy::all("socks5h://127.0.0.1:9050").expect("tor proxy should be there");
let client = reqwest::Client::builder()
.proxy(proxy)
.build()