• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting ipv4 remote address from FacesContext

 
Lucas Piva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want the get a client's IP address from jsf. With a little search effort, I could come up with this:



Problem is, address is coming in ipv6 format. I searched around quite a bit and couldn't find any info on this. Is the address being returned as ipv6 because of network specific configurations or is JSF returning it as ipv6 by default?

If so, how do I tell JSF to return it as an ipv4 address?

Thanks in advance.
 
Lucas Piva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Discovered the problem. Apparently, the server was running on a badly configured subnet or something. I started the server on another network and it worked fine.
 
Thomas Willingham
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you may also want to check the http header for the referer ip if the ip can not be detected or is being proxied by a proxy that doesn't remove it , by reading the http header
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!