cyfer65 Posted August 2, 2011 Share Posted August 2, 2011 how can I set the HTTP_X_FORWARDED_FOR header in a curl request so when I curl this site:http://dawhois.com/my_ip_address.phpmy real IP shows up for the "IP Behind Proxy" Section..? Link to comment Share on other sites More sharing options...
whh-kevinw Posted August 2, 2011 Share Posted August 2, 2011 Hi cyfer65,I recommend that you try the following: curl_setopt($ch,CURLOPT_HTTPHEADER,array('HeaderName: HeaderValue')); as in: curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-FORWARDED-FOR: 1.2.3.4')); curl_setopt can probably be used to send headers: http://php.net/manual/en/function.curl-setopt.php Link to comment Share on other sites More sharing options...
cyfer65 Posted August 2, 2011 Author Share Posted August 2, 2011 does that code work for you..?I try it and it still shows "IP Behind Proxy = None"is it not possible to show my real ip behind a curl request..? Link to comment Share on other sites More sharing options...
boen_robot Posted August 2, 2011 Share Posted August 2, 2011 You can use the CURLOPT_HTTPHEADER option. Keep in mind that the name of the header is really X-Forwarded-For. So... $ch = curl_init('http://dawhois.com/my_ip_address.php');$headers = array('X-Forwarded-For: ' . $_SERVER['REMOTE_ADDR']//Add additional headers here.);curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);$result = curl_exec($ch); curl_close($ch); [edit]Damn... beated to it [/edit] Link to comment Share on other sites More sharing options...
cyfer65 Posted August 2, 2011 Author Share Posted August 2, 2011 did you guys test those codes..?i try em and still "IP Behind Proxy = None"what does it show for you guys..? Link to comment Share on other sites More sharing options...
boen_robot Posted August 2, 2011 Share Posted August 2, 2011 Shows the same thing...Perhaps the site uses a different technique to detect proxies, or it only assumes a proxy if the proxy's IP (i.e. your server's IP) is among a certain whitelist of known proxies. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.