This is a discussion on PHP: how to access whois server through proxy ? within the PHP General forums, part of the PHP Programming Forums category; Hi, I need to connect to whois server through proxy in PHP. I know how to use HTTP proxy and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I need to connect to whois server through proxy in PHP. I know how to use HTTP proxy and i know how to access whois server, but i don't know how to combine both. Below is code i use, i will be very thankful for any help: ---------- $proxy_sock = "68.250.64.89"; $sock_port = 8941; $proxy_http = "195.246.155.194"; $http_port = 80; $request_url = "http://www.google.com/"; $whois_server = "whois.verisign-grs.com"; $domain = "domain google.com"; //WORKING SHOW HTTP THROUGH PROXY /* $proxy_fp = fsockopen($proxy_http, $http_port); if (!$proxy_fp) { echo "error opening proxy"; } else { fputs($proxy_fp, "GET $request_url HTTP/1.0\r\nHost: $proxy_http\r\n\r\n"); while(!feof($proxy_fp)){ $line = fgets($proxy_fp, 4000); print($line); } echo "Success !"; } fclose($proxy_fp); */ //WORKING GET WHOIS INFO DIRECTLY /* $whois_server = "whois.verisign-grs.com"; $domain = "domain google.com"; $connection = @fsockopen($whois_server, 43); if (!$connection) { unset($connection); $this->msg = "Can't connect to the server $whois_server !"; return; } else { sleep(2); fputs($connection, "$domain\r\n"); while (!feof($connection)) { $line = fgets($connection, 4096); echo $line."<BR>"; } } fclose($connection); */ --------------- Thanks! |