You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by "Brette, Marc" <Ma...@mkms.xerox.com> on 2002/05/03 15:03:17 UTC

Set the client IP address in a Cactus WebRequest

Hi,
Is it possible to fake the IP address of a client in a Cactus WebRequest ?
I have a servlet that check that the user IP address matches an expected
value and I would like to test it using Cactus.
 
Thanks,
Marc

RE: Set the client IP address in a Cactus WebRequest

Posted by "Rajagopal. V" <ra...@yahoo.com>.
You can use the getRemoteAddr() on the SErvletRequest
interface to get the Remote IP address. 

--- Vincent Massol <vm...@octo.com> wrote:
> Hi Marc,
> 
> Hum ... The answer is probably yes. This information
> is passed in an
> HTTP header right ? Then you should be able to use
> the
> WebRequest.addHeader() (However that would only add
> a new header, not
> replace an existing one).
> 
> How do you get the IP value on the server side (what
> API do you use ?).
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Brette, Marc
> [mailto:Marc.Brette@mkms.xerox.com]
> > Sent: 03 May 2002 14:03
> > To: 'cactus-user@jakarta.apache.org'
> > Subject: Set the client IP address in a Cactus
> WebRequest
> > 
> > Hi,
> > Is it possible to fake the IP address of a client
> in a Cactus
> WebRequest ?
> > I have a servlet that check that the user IP
> address matches an
> expected
> > value and I would like to test it using Cactus.
> > 
> > Thanks,
> > Marc
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Set the client IP address in a Cactus WebRequest

Posted by Vincent Massol <vm...@octo.com>.
Hi Marc,

Hum ... The answer is probably yes. This information is passed in an
HTTP header right ? Then you should be able to use the
WebRequest.addHeader() (However that would only add a new header, not
replace an existing one).

How do you get the IP value on the server side (what API do you use ?).

Thanks
-Vincent

> -----Original Message-----
> From: Brette, Marc [mailto:Marc.Brette@mkms.xerox.com]
> Sent: 03 May 2002 14:03
> To: 'cactus-user@jakarta.apache.org'
> Subject: Set the client IP address in a Cactus WebRequest
> 
> Hi,
> Is it possible to fake the IP address of a client in a Cactus
WebRequest ?
> I have a servlet that check that the user IP address matches an
expected
> value and I would like to test it using Cactus.
> 
> Thanks,
> Marc


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>