Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class TorProxy{
  2. public function getTorConnection($base){
  3. $ch= curl_init();
  4. curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  5. curl_setopt($ch, CURLOPT_PROXY, 'http://127.0.0.1:9050');
  6.  
  7. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  8. curl_setopt($ch, CURLOPT_HEADER, false);
  9. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  10. curl_setopt($ch, CURLOPT_URL, $base);
  11. curl_setopt($ch, CURLOPT_REFERER, $base);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  13. 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');
  14. $str = curl_exec($ch);
  15. curl_close($ch);
  16. return $str;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement