Я пытаюсь создать веб-клиент, используя actix_web, но получаю сообщение об ошибке: ошибка Connect (Timeout)
[root@webclient]# cargo run Compiling webclient v0.1.0
(/apps/rust/projects/webclient)
Finished dev [unoptimized + debuginfo] target(s) in 5.73s
Running `target/debug/webclient`
Error: Connect(Timeout)
use actix_rt::System;
use actix_web::client::Client;
use futures::future::Future;
use futures::lazy;
use actix_http::Error;
fn main() -> Result<(), Error> {
System::new("test").block_on(lazy(|| {
let client = Client::default();
client.get("https://example.org/") // <- Create request builder
.send() // <- Send http request
.from_err()
.and_then(|mut response| { // <- server http response
println!("Response: {:?}", response);
response
.body()
.from_err()
.map(|body| println!("Downloaded: {:?} bytes", body))
})
}))
}