tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.29k stars 1.35k forks source link

Support curl's --connect-to parameter #691

Closed dankegel closed 1 month ago

dankegel commented 1 month ago

Proposal

Implement curl's --connect-to parameter

The draft PR https://github.com/tsenart/vegeta/issues/576 seems to work, and would be an improvement over the current situation. I have rebased it and updated the usage message to provide slightly better guidance; result is https://github.com/tsenart/vegeta/pull/692

The remaining downside is that it doesn't support empty fields as curl does, but maybe the added example in the usage message will make it clear enough for new users.

(See https://github.com/curl/curl/blob/58772b0e082eda333e0a5fc8fb0bc7f17a3cd99c/lib/url.c#L2888 etc shows that the first two fields match any source if empty; https://github.com/curl/curl/blob/58772b0e082eda333e0a5fc8fb0bc7f17a3cd99c/lib/url.c#L2782 shows that the final two fields may be empty and mean "no change" in that case.)

Background

In an environment where DNS always gives the wrong answer, and cannot be changed, it is common for people to use curl --connect-to to test connections and debug. Let's make it easier for them to adopt vegeta.

Workarounds

Set up a custom DNS server, but that's not always convenient or possible.

tsenart commented 1 month ago

Closed by 647dacc

Release: https://github.com/tsenart/vegeta/releases/tag/v12.12.0