You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that client example fails with nginx on raspberrypi 4B.
It's OK on local nginx and httpd on raspberry pi.
I slightly modified client example to my environment.
use async_h1::client;use async_std::net::TcpStream;use http_types::{Error,Method,Request,Url};#[async_std::main]asyncfnmain() -> Result<(),Error>{// Address for my raspberry pi 4B// On raspberry pi, server is runnning via `docker run -d -p 80:80 nginx`let stream = TcpStream::connect("192.168.10.50:80").await?;let peer_addr = stream.peer_addr()?;println!("connecting to {}", peer_addr);for i in0usize..2{println!("making request {}/2", i + 1);let url = Url::parse(&format!("http://{}/", peer_addr)).unwrap();// Changed URL to /let req = Request::new(Method::Get, url);let res = client::connect(stream.clone(), req).await?;println!("{:?}", res);// dbg!(res.body_string().await); // Works fine if this line is uncommented}Ok(())}
// dbg!(res.body_string().await); // Works fine if this line is uncommented
As I commented above, it succeeds if read the body of the first request.
After some investigation, I've found that async-h1 reads the first body as the second header and fails.
Still, I don't know why it fails only nginx on raspberry pi and success on other servers.
The text was updated successfully, but these errors were encountered:
I've found that
client
example fails with nginx on raspberrypi 4B.It's OK on local nginx and httpd on raspberry pi.
I slightly modified
client
example to my environment.And when it runs.
Failed on second request.
As I commented above, it succeeds if read the body of the first request.
After some investigation, I've found that
async-h1
reads the first body as the second header and fails.Still, I don't know why it fails only nginx on raspberry pi and success on other servers.
The text was updated successfully, but these errors were encountered: