java - Is Apache Tomcat blocking the client IP address? -


i have deployed web application on tomcat 6.0 in machine having ip address 10.xx.xx.90. making http request(from browser) app m/c having ip address (10.xx.xx.56).

i trying ip address of client(10.xx.xx.56) in servlet filter using below code.but not getting value remoteaddress parameter in header info , request.getremoteaddr() returns ip address of machine on application deployed i.e 10.xx.xx.90. there no loadbalancer or proxy in between.

public void dofilter(servletrequest request, servletresponse response, filterchain    chain) throws ioexception,   servletexception { httpservletrequest httpservletrequest = (httpservletrequest) request; stringbuffer iplog = new stringbuffer("filter_log").append(httpservletrequest.getremoteaddr()); enumeration<string> e = httpservletrequest.getheadernames(); if (e != null) {   while (e.hasmoreelements()) {     string header = e.nextelement();     iplog.append(header).append(" - ").append(httpservletrequest.getheader(header));   } } system.out.println(iplog); 

is tomcat blocking or changing client ip address here ? if yes, configuration need change real client ip address ?

thanks in advance..

you in fact connecting through proxy

as noted in comments question, client connecting through tunnel server, means 1 doing actual request server server side of tunnel.

that why getting local ip "remoteaddr"

let tomcat listen public interface, or interfaces, , connect straight server ip instead of through tunnel.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -