Skip to content

armgit / hey

Public Imported from GitHub
0

HTTP load generator, ApacheBench (ab) replacement

Go

Allow overriding the HTTP Host header

Rafael Martins8c485028b251
diff --git a/boom.go b/boom.go
index b7465a8..5ac371c 100644
--- a/boom.go
+++ b/boom.go
@@ -51,6 +51,7 @@ var (
accept = flag.String("A", "", "")
contentType = flag.String("T", "text/html", "")
authHeader = flag.String("a", "", "")
+ hostHeader = flag.String("host", "", "")
output = flag.String("o", "", "")
@@ -91,6 +92,7 @@ Options:
connections between different HTTP requests.
-cpus Number of used cpu cores.
(default for current machine is %d cores)
+ -host HTTP Host header.
`
func main() {
@@ -169,6 +171,11 @@ func main() {
req.SetBasicAuth(username, password)
}
+ // set host header if set
+ if *hostHeader != "" {
+ req.Host = *hostHeader
+ }
+
(&boomer.Boomer{
Request: req,
RequestBody: *body,