Reputation: 11
I'm using URLConnection
to connect to a site. I used System.getProperties()
to set the proxyHost
and proxyPort
, and connection.setRequestProperty
to change the user-agent. I haven't seen a way to change the X-Forwarded-For.
Can someone enlighten me?
Thanks!
Upvotes: 1
Views: 3421
Reputation: 4829
Try the below:
connection.addRequestProperty("X-Forwarded-For",VALUE-IP);
Reference: http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLConnection.html#addRequestProperty(java.lang.String, java.lang.String)
Upvotes: 3