G2A Many GEOs
SHARE
TWEET

proxy.php

DJ_PhoeniX Nov 23rd, 2013 692 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.         if(!isset($_SERVER['PROXY_PASS'])) die('Security error');
  3.         $request  = $_SERVER["REQUEST_METHOD"]." http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]." HTTP/1.0\n";
  4.         $request .= "Host: ".$_SERVER["HTTP_HOST"]."\n";
  5.         if(isset($_SERVER['HTTP_ACCEPT'])) $request .= "Accept: ".$_SERVER["HTTP_ACCEPT"]."\n";
  6.         if(count($_COOKIE)) {
  7.                 $cookies = array();
  8.                 foreach($_COOKIE as $k=>$v) $cookies[] = URLEncode($k).'='.URLEncode($v);
  9.                 $request .= "Cookie: ".implode('; ',$cookies)."\n";
  10.         }
  11.         if(isset($_SERVER['HTTP_USER_AGENT'])) $request .= "User-Agent: ".$_SERVER["HTTP_USER_AGENT"]."\n";
  12.         if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $request .= "Accept-Language: ".$_SERVER["HTTP_ACCEPT_LANGUAGE"]."\n";
  13.         if(isset($_SERVER['HTTP_ACCEPT_ENCODING'])) $request .= "Accept-Encoding: ".$_SERVER["HTTP_ACCEPT_ENCODING"]."\n";
  14.         if($_SERVER['REQUEST_METHOD']=='POST'){
  15.                 if(isset($_SERVER['HTTP_CONTENT_TYPE'])) $request .= "Content-Type: ".$_SERVER["HTTP_CONTENT_TYPE"]."\n";
  16.                 $post_data = file_get_contents("php://input");
  17.                 $request .= "Content-Length: ".strlen($post_data)."\n";
  18.                 $request .= "\n";
  19.                 $request .= $post_data;
  20.                 $request .= "\n";
  21.         } else {
  22.                 $request .= "\n";
  23.         }
  24.         $proxy = explode(':',$_SERVER['PROXY_PASS']);
  25.         $port = array_pop($proxy);
  26.         $host = implode(':',$proxy);
  27.         $sock = fsockopen($host,$port,$s,$s,3);
  28.         fwrite($sock,$request);
  29.         while($p = fread($sock,255)){
  30.                 $ret .= $p;
  31.         }
  32.  
  33.         $ret = explode("\n",$ret);
  34.         while(($h = trim(array_shift($ret))) != ""){
  35.                 if(substr($h,0,6)!="Proxy-")
  36.                         Header($h);
  37.         }
  38.         echo implode("\n",$ret);
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top