0

Want simulate different IP address requests (I want set output IP address to my outgoing request). When I'm doing HttpURLConnection GET request at the destination I'm getting my local IP address which is localhost.

    HttpURLConnection con = (HttpURLConnection) obj.openConnection();

But I want get some normal address at the destination to test GEO location system. How I can do it? Do I need to create some kind of local proxy?

Lugaru
  • 1,430
  • 3
  • 25
  • 38
  • The IP address is determined on a lower layer - you cannot change/simulate the IP in a high level HTTP request. Check [here](http://stackoverflow.com/questions/18266211/generating-httprequest-from-specific-ip-in-java) – fishi0x01 Mar 29 '15 at 14:47
  • 1
    If you *connect* to localhost, then the source address is also localhost. If you connect to an external IP address of your machine, you will see that external address as the source address of your connection. – Erwin Bolwidt Mar 29 '15 at 14:56

0 Answers0