php - Getting Resource from fsockopen behing proxy -
i have existing code :
$socket = fsockopen(host, port);
where $socket returned here resource. however, need behind proxy server authentication. sure done via
public static function returndata($url, $port) { $fp = fsockopen(static::$ip, static::$port); // connect proxy $login = static::$login; $passwd = static::$passwd; fputs($fp, "get <a href=\"https://$url/\" " . "title=\"https://$url/\">https://$url/</a> http/1.1\r\n" . "host:$url:$port\r\n" . "proxy-authorization: basic " . base64_encode("$login:$passwd") . "\r\n\r\n"); $data = ""; while (!feof($fp)) $data .= fgets($fp, 64000); fclose($fp); return $data; }
but function here returns string , not resource.
how can resource returned or how resource retrieved using curl
Comments
Post a Comment