Re: FW: servlet request header information

2009-07-29 Thread Martin Makundi
Some proxies can be configured to forward the real client address:

  - Apache ProxyPreserveHost Directive
  - Description: Use incoming Host HTTP request header for proxy request
  - Syntax: ProxyPreserveHost On|Off
  - Default: ProxyPreserveHost Off
  - Context: server config, virtual host
  - Status: Extension
  - Module: mod_proxy
  - Compatibility:  Available in Apache 2.0.31 and later.
- mod_header directives:
  • RequestHeader set|append|add|unset header [value]
- ProxyPass / http://backend.covalent.net
  • ProxyPassReverse / http://backend.covalent.net
  • RequestHeader set X-Forwarded-IP %{REMOTE_ADDR}e
  • RequestHeader set X-Request-Scheme %{REQUEST_SCHEME}e


 I want to get some information from request  header using something like the
 code bellow but for my requests I receive null.

You could use a debugger and see if the whole property map is null or
maybe the names are lowercase?

**
Martin




                                HttpServletRequest request =
 ((ServletWebRequest) getRequest())


 .getHttpServletRequest();

                                System.out.println(Http via:
 +request.getHeader(HTTP_VIA));

                                System.out.println(Remote adr:
 +request.getHeader(REMOTE_ADDR));

                                System.out.println(X_FORWARD adr:
 +request.getHeader(HTTP_X_FORWARDED_FOR));





 Can anyone tell me if there is other way to get all these information.



 In fact I want to get the ip address of the request. Using the
 request.getRemoteAddr() I receive only the proxy ip and not the real one.



 Thanks in advance!

 Tomike





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: FW: servlet request header information

2009-07-29 Thread Mihai Toma
Thanks, but we are using here an OC4J server so we can’t add Apache
ProxyPreserveHost Directive.


-Original Message-
From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] 
Sent: Wednesday, July 29, 2009 12:59 PM
To: users@wicket.apache.org
Subject: Re: FW: servlet request header information

Some proxies can be configured to forward the real client address:

  - Apache ProxyPreserveHost Directive
  - Description: Use incoming Host HTTP request header for proxy request
  - Syntax: ProxyPreserveHost On|Off
  - Default: ProxyPreserveHost Off
  - Context: server config, virtual host
  - Status: Extension
  - Module: mod_proxy
  - Compatibility:  Available in Apache 2.0.31 and later.
- mod_header directives:
  • RequestHeader set|append|add|unset header [value]
- ProxyPass / http://backend.covalent.net
  • ProxyPassReverse / http://backend.covalent.net
  • RequestHeader set X-Forwarded-IP %{REMOTE_ADDR}e
  • RequestHeader set X-Request-Scheme %{REQUEST_SCHEME}e


 I want to get some information from request  header using something like
the
 code bellow but for my requests I receive null.

You could use a debugger and see if the whole property map is null or
maybe the names are lowercase?

**
Martin




                                HttpServletRequest request =
 ((ServletWebRequest) getRequest())


 .getHttpServletRequest();

                                System.out..println(Http via:
 +request.getHeader(HTTP_VIA));

                                System.out..println(Remote adr:
 +request.getHeader(REMOTE_ADDR));

                                System.out..println(X_FORWARD adr:
 +request.getHeader(HTTP_X_FORWARDED_FOR));





 Can anyone tell me if there is other way to get all these information.



 In fact I want to get the ip address of the request. Using the
 request.getRemoteAddr() I receive only the proxy ip and not the real one.



 Thanks in advance!

 Tomike





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: FW: servlet request header information

2009-07-29 Thread Martin Makundi
Well.. similar options you can find in OC4J proxy too. Or else you
will not get the client ip (it is not possible to get it if the proxy
does not deliberately pass it).

**
Martin

2009/7/29 Mihai Toma mihai.t...@asf.ro:
 Thanks, but we are using here an OC4J server so we can’t add Apache
 ProxyPreserveHost Directive.



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org