Advertisement
TheRockettek

https proxy

Apr 9th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. $url = $_GET['url'];
  3.  
  4. $headers = apache_request_headers();
  5.  
  6. foreach($headers as $key => $value) {
  7.         if ( $key == "Contenttype" ) {
  8.         $headers['Content-Type'] = $value;
  9.         $headers['Contenttype'] = nil;
  10.         }
  11.         if ( $key == "Auth" ) {
  12.         $headers['Authorization'] = $value;
  13.         $headers['Auth'] = nil;
  14.         }
  15. }
  16.  
  17. if ( !$url ) {
  18.   die("No url");
  19. } else {
  20.   $ch = curl_init( $url );
  21.   if ( strtolower($_SERVER['REQUEST_METHOD']) == 'post' ) {
  22.     curl_setopt( $ch, CURLOPT_POST, true );
  23.     curl_setopt( $ch, CURLOPT_POSTFIELDS, $_POST );
  24.   }
  25.   curl_setopt( $ch, CURLOPT_URL, $url);
  26.   curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
  27.   $contents = curl_exec( $ch );
  28.   curl_close( $ch );
  29. }
  30.  
  31. print substr($contents,1,strlen($content)-1);
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement