[httperf] Regarding adding http headers

Martin F. Arlitt httperf@napali.hpl.hp.com
Mon, 13 Aug 2001 14:59:00 +0000


the Host header is included by default when using
http/1.1 (which is also the default in httperf).  I believe
the problem is your httperf command below is actually
sending the proxy two Host: headers.  httperf will
automatically add the header "Host:",
and you are asking it to add "Host: www.yahoo.com".
This is likely causing your proxy to become confused.

if you want to send "Host: www.yahoo.com" rather than
Host:", the --no-host-hdr option in
httperf/0.8 will disable the default behaviour of including
a Host: header; you can then specify the Host: header
using the "--add-header" option.

you should be able to simplify your command to:

httperf --server --port 2234
--uri http://www.yahoo.com --print-reply --print-request
--debug 3 --no-host-hdr --add-header "Host: www.yahoo.com"

as the other options you specified are defaults.  please note
that while httperf may be used for testing various features
(or performance) of proxies it is designed for testing Web servers.
please be sure to carefully monitor the headers that are issued to
ensure that you are evaluating the protocol compliance of the
proxy and not introducing errors by utilizing httperf for a
task it was not designed for.


Gayathri Ramakrishnan wrote:

> Hi,
> We are using httperf for doing http complacence testing of one
> of our servers. This server expects a "Host" header along
> with the "GET" request in order to retrive the requested URI.
> How do I include this header using the httperf tool. I am aware
> of the option called "add-header" in the tool. I tried using this
> as follows.
> httperf --server --port 2234 --num-conns 1 --num-calls 1
> --uri http://www.yahoo.com --print-reply --print-request --http-version
> 1.1 -debug 3 --method GET --add-header "Host: www.yahoo.com"
> but it doesn't seem to be retriving the page for me. But when
> I try simulating the same thru telnet and issue a GET it works.
> telnet 2234                                    Trying
>                                           Connected to
> Escape character is '^]'.
> GET http://www.yahoo.com HTTP/1.1
> Host: www.yahoo.com
> HTTP/1.0 200 OK
> Date: Thu, 09 Aug 2001 04:37:32 GMT
> Content-Type: text/html
> X-Cache: MISS from npd-proxy.hcltech.com
> Proxy-Connection: close
> X-Squid-Reserve:
> X-Squid-MaxCount:
> <html><head><title>Yahoo!</title><base href=http://www.yahoo.com/
> target=_top><m
> eta http-equiv="PICS-Label" content='(PICS-1.1
> "http://www.rsac.org/ratingsv01.h
> tml" l gen true for "http://www.yahoo.com" r (n 0 s 0 v 0 l 0))'></head>
> <script language="javascript">
> function ch() {
> .................
> ....................
> Let me know how this problem can be solved.
> Thanks,
> Gayathri
> --
> To unsubscribe: echo unsubscribe httperf | mail majordomo@linux.hpl.hp.com

To unsubscribe: echo unsubscribe httperf | mail majordomo@linux.hpl.hp.com