codesenberg / bombardier

Fast cross-platform HTTP benchmarking tool written in Go
MIT License
6.06k stars 317 forks source link

Getting error as "HostClient can't follow redirects to a different protocol, please use Client instead - 6111380" #75

Open kranthikumar-kvs-by opened 3 years ago

kranthikumar-kvs-by commented 3 years ago

Getting error as "HostClient can't follow redirects to a different protocol, please use Client instead - 6111380", is there any settings we can set that ignores the redirect URLs.

calbot commented 3 years ago

I get the same issue. Something is wrong with fasthttp for tls connections it seems.

darlanmoraes commented 3 years ago

I am getting the same error as well. I see the same problem on Mac OS and Linux.

cfauchere commented 3 years ago

I see the same error when using https scheme. adding --http2 flag in the command seems to address the problem

bocharsky-bw commented 2 years ago

Nice catch @cfauchere , thanks for sharing the workaround!

I wonder if it's by design that --fasthttp does not support HTTPS? Or is it a bug in this lib?

codesenberg commented 1 year ago

Thanks for the report and all of your inputs.

Looks like there was a backwards incompatible change in fasthttp.HostClient's behaviour (see valyala/fasthttp#800). That said, I'm not sure if fasthttp.Client handles this case any better.

@bocharsky-bw:

I wonder if it's by design that --fasthttp does not support HTTPS?

Both fasthttp and bombardier (with --fasthttp which is default) support HTTPS. A caveat here is that bombardier DOES NOT follow redirects, feel free to file a feature request or contribute this feature via a pull request, if this is something you'd like bombardier to be able to do.

@kranthikumar-kvs-by:

Getting error as "HostClient can't follow redirects to a different protocol, please use Client instead - 6111380", is there any settings we can set that ignores the redirect URLs.

A bit more context here would be very welcome. I.e. full command used and its output, what kind of server was used, etc.. Ideally, a minimal reproducible example.

My best guess given all the feedback provided is that this happens when one tries to send HTTPS requests to a server that only supports HTTP and tries to change the protocol used, but might be wrong.