Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TorProxy{
- public function getTorConnection($base){
- $ch= curl_init();
- curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
- curl_setopt($ch, CURLOPT_PROXY, 'http://127.0.0.1:9050');
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_URL, $base);
- curl_setopt($ch, CURLOPT_REFERER, $base);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30');
- $str = curl_exec($ch);
- curl_close($ch);
- return $str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement