codesenberg / bombardier

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

Option to save response of the request #93

Open SomnathS09 opened 1 year ago

SomnathS09 commented 1 year ago

Please provide an option to save response body

What version of bombardier are you using?

v1.2.5

What operating system and processor architecture are you using (if relevant)?

windows/amd64

What you expected to happen?

save response body of the request

What actually happened?

only gives http status code like 2xx, 4xx, etc.

codesenberg commented 1 year ago

This looks like something we could implement at some point.

amir20 commented 1 year ago

I am seeing all my requests as 3xx but no idea what is happening. This could help me understand the error. Is there any other way for me to know the response?

codesenberg commented 1 year ago

@amir20, well that should be easy. If all of the responses are 3xx, then just send a single equivalent request with curl (or similar utility) and inspect the response.

amir20 commented 1 year ago

That's the issue. Both curl and http are showing normal output.

See below...

❯ bombardier https://www.clashleaders.com/
Bombarding https://www.clashleaders.com:443/ for 10s using 125 connection(s)
[================================================================================================================================================] 10s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec        50.94     491.65    5714.64
  Latency         1.98s   394.55ms      4.00s
  HTTP codes:
    1xx - 0, 2xx - 0, 3xx - 50, 4xx - 0, 5xx - 0
    others - 585
  Errors:
    tls handshake timed out - 585
  Throughput:    21.19KB/s
❯ curl -I https://www.clashleaders.com/
HTTP/2 200
content-type: text/html; charset=utf-8
date: Sun, 28 May 2023 19:21:09 GMT
set-cookie: csrf_token=IjgyYjM0MDY1MGM1NWRhOWM4ZjA0NDAwZDMzODIwMTRmNjExNTdjZDEi.ZHOppQ.uBOUb9omEriMgcmph31pRfoMGHo; Path=/
set-cookie: session=eyJjc3JmX3Rva2VuIjoiODJiMzQwNjUwYzU1ZGE5YzhmMDQ0MDBkMzM4MjAxNGY2MTE1N2NkMSJ9.ZHOppQ.ciOQwlMUxib7t5csKf5z5u3xmUE; HttpOnly; Path=/; SameSite=Lax
strict-transport-security: max-age=315360000; preload
vary: Cookie
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 1; mode=block
content-length: 49160

Ideally, I'd like to see what is causing the 3xx requests but I haven't been able to figure it out.

I am guessing something with SSL handshake.

Same errors with --http2 and --http1

codesenberg commented 1 year ago

I am guessing something with SSL handshake.

Nope. Actually, it's just 301 in case of this site. Not sure why would they redirect to the exact same location, but that's a different issue. In case you need further assistance file a separate issue, since this one is for the general feature discussion, not to troubleshoot oddness like the one you've encountered.

amir20 commented 1 year ago

Thanks. I am the owner of https://www.clashleaders.com/. I don't send any 301 redirects. But that's ok. I was just testing this tool.

onionhammer commented 4 months ago

In this case, just knowing whether it was 400 or 429 (instead of lumping everything into 4xx) would make a huge difference.