Suppose the hostname you DON't WANT is bar.sun.com

You can then fake it out by 
A) Creating an entry in /etc/hosts for the name you want it to be.
Suppose this is foo.sun.com. Point foo.sun.com to the IP address of
bar.sun.com.

B) Only call the host by the name foo.fun.com. Then the host header in
the request will show foo.sun.com, while getting sent to bar.sun.com.

  

-----Original Message-----
From: otsuka [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 11:55 AM
To: [email protected]
Subject: How to overwrites Host header

Hi,

I want HttpClient to send "Host" request header value
which is different with the host connected. This
behaviour is necessary for authentication purpose.

Is it possible to overwrites Host header?
If yes, could you tell me how?

(my desired behaviour log)
DEBUG org.apache.commons.httpclient.HttpConnection  - Open connection
to www.example.com:80
DEBUG httpclient.wire.header  - >> "POST /path/to/something
HTTP/1.1[\r][\n]"
DEBUG httpclient.wire.header  - >> "Host: another.example.com[\r][\n]"


Regards,
Otsuka

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to