I'm trying to use ab to test my webserver, but it only supports HTTP/1.1 (reject requests that have HTTP/1.0 in the first line). The -k switch only adds a header with connection: keep-alive.
Is it possible to make ab send HTTP/1.1 request?
I'm trying to use ab to test my webserver, but it only supports HTTP/1.1 (reject requests that have HTTP/1.0 in the first line). The -k switch only adds a header with connection: keep-alive.
Is it possible to make ab send HTTP/1.1 request?
A way found in CMU's 15-441:
perl -pi -e 's/HTTP\/1.0/HTTP\/1.1/g' /usr/bin/ab
Hacky, but it works! :D
here my optimization based on @ch271828n and @likebike
sed 's|HTTP/1.0|HTTP/1.1|g' /usr/bin/ab >ab-http11
chmod +x ab-http11
./ab-http11 -V
./ab-http11 -l -n 6 -c 2 -v 2 "https://mytestapp.com/test123"
btw without HTTP1.1 got HTTP/1.1 426 Upgrade Required when testing behind Envoy proxy
see also here: https://github.com/envoyproxy/envoy/issues/18608