How to simulate different location while testing localhost ?
I am using the java play framework, where I get the users IP Address when he posts a form. While testing, I save the address and all I get is the localhost 0:0:0:0:0:0:0:1%0. I want to be able to test this in a variety of locations, and use different IP addresses to test this and get the user’s location from the IP address.
What would be the best way to go about this ?
If you know the structure the IP is read from you can simulate this and test it with different IPS you set. But why do you need that? if your testing localhost and its working it seems you can read the IP in the right way.
If you are doing anything with the IP like determining the country its comming from for example, you can test this using constant IPs, but testing the IP with different hosts is to test the function to get the IP which is actually a basic thing i wouldnt personally test.
From the comments:
You can use something like this: hostip.info/use.html