cancel
Showing results for 
Search instead for 
Did you mean: 

How to get client Ip Address in Java

Former Member
0 Kudos

Hi

I am getting some Private IP when I am trying to get my own IP. Its working fine in local but in production giving private IP instaed of My IP with the below code.

String ipAddress = request.getHeader("X-FORWARDED-FOR");

why it is giving different IP instead of my IP when i am hitting as a user in Production.

Thanks

Penchal

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member193379
Active Contributor
0 Kudos

Hi Penchal,

You are using the correct way to get it but I didn't understand your proiblem. Can you please elaborate bit more your problem please.

Thanks,

Hamendra