is possible use user's current ip address proxy address php curl? currently, trying following code giving request time out error. test hma proxy working fine when i'm trying uses user's ip address giving request time error in server's log.
function get_page($url){ $proxy=$_server['remote_addr'].":80"; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_proxy, $proxy); curl_setopt($ch, curlopt_header, 0); // return headers 0 no 1 yes curl_setopt($ch, curlopt_returntransfer, true); // return page 1:yes curl_setopt($ch, curlopt_timeout, 40); // http request timeout 20 seconds curl_setopt($ch, curlopt_followlocation, true); // follow redirects, need if url changes curl_setopt($ch, curlopt_maxredirs, 2); //if http server gives redirection responce curl_setopt($ch, curlopt_useragent, "mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.8.1.7) gecko/20070914 firefox/2.0.0.7"); curl_setopt($ch, curlopt_cookiejar, "cookies.txt"); // cookies storage / here changes have been made curl_setopt($ch, curlopt_cookiefile, "cookies.txt"); curl_setopt($ch, curlopt_ssl_verifypeer, false); // false https curl_setopt($ch, curlopt_encoding, "gzip"); // page encoding $data = curl_exec($ch); // execute http request curl_close($ch); // close connection return $data; } there lots of live examples doing same. example these 2 tools google
- google.com/gwt/x
- developers.google.com/speed/pagespeed/insights
not possible. while make server issue syn packet using user's ip "source", reply packets target machine go user's machine, not server.
it not possibl spoof complete tcp connection unless control network infrastructure upstream of target/victim.
Comments
Post a Comment