Open kateabr opened 3 years ago
Can you try this code using the awc
beta?
Check with Wireshark for instance, if you connect on basis of HTTP/1.0 or HTTP/1.1. 1.0 is a performance hit, so forcing it to use HTTP/1.1 or even HTTP/2 should speed up. Wireshark helps a lot with debugging weird activity on your connectivity, filter connection on basis of port 80 or 443 (SSL), Wireshark let you read out the packets it send and receive as well, and could help determining where the issue could be.
1.0 is a performance hit, so forcing it to use HTTP/1.1 or even HTTP/2 should speed up.
@Power2All how can we force 1.1? I've tried using the Upgrade header to request 1.1, but actix-web continues to use 1.0. I can't find any documentation in the actix-web docs about how to set the protocol. Additional context: I'm running locally on Windows 10.
@Power2All how can we force 1.1?
Apache does return a HTTP/1.1 when a HTTP/1.0 or even HTTP/0.9 is received. This way you can force the usage of HTTP/1.1 The upgrade header only works on HTTP/1.1, HTTP/1.0 and lower doesn't have this function.
Reproduce snippet:
This code prints "20" on Windows, i.e. get request to Google takes 20 seconds.
Same code on Linux (WSL2) takes 0 seconds.
I don't have any clues what might be wrong, but perhaps it's related to DNS resolution?
Cargo.toml
: