Page 1 of 6 123 ... LastLast
Results 1 to 10 of 58

Thread: Remember Suffix Proxy?

  1. #1
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    632
    Thanks
    192
    Thanked 104 Times in 82 Posts

    Remember Suffix Proxy?

    Suffix Proxy was pretty cool and original. Does anyone remember it?

    Let's say you want to visit google.com and the suffix proxy is located at example.com. You would go to http://www.google.com.example.com and the script would use a DNS wildcard to visit the site. The site then loaded in the browser without a separate address bar (like Glype and PHPRoxy have) and things on the site would still be very functional. It did not anonymize the connection, but it was a powerful unblocker.

    The original site went offline but I have the script and so do other people. Does anyone have configuration instructions for it?

    I'm trying to get a little revival going here.

  2. #2
    Kovich's Avatar
    Kovich is offline Community Guardian
    Join Date
    Jan 2009
    Location
    Philadelphia, Pennsylvania
    Posts
    1,797
    Blog Entries
    30
    Thanks
    453
    Thanked 420 Times in 279 Posts
    That sounds really awesome. Could you upload the files somewhere for the rest of us? I'd love to set one up.

  3. #3
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    632
    Thanks
    192
    Thanked 104 Times in 82 Posts
    Quote Originally Posted by Kovich View Post
    That sounds really awesome. Could you upload the files somewhere for the rest of us? I'd love to set one up.
    I probably should have done that in the first place

    You also need to set up a DNS wildcard for *.yourname.com which can be done via cPanel's subdomain manager and adding a * as the name of the subdomain. If you're editing DNS manually, the wildcard looks like this:

    * 14400 IN A 1.1.1.1

    Replace 1.1.1.1 with the proper IP for your domain name. Apache shared virtualhost IPs work fine with this.

    This goes into .htaccess, replacing 6a.nl with your domain name:

    Code:
    RewriteCond %{HTTP_HOST} ^www.6a.nl$
    RewriteRule ^(.*) http://6a.nl/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} !^6a.nl$
    RewriteCond %{REQUEST_URI} !^/browse.php
    RewriteCond %{REQUEST_URI} !^/robots.txt$
    RewriteRule .* /browse.php [L]
    This is the PHP code for browse.php, again replace 6a.nl with your actual domain name.

    PHP Code:
    <?php

    define
    ("PROXY_SUFFIX"".6a.nl"); // domain name suffix to reply for

    /*

    // Author: Maurits van der Schee
    // License: GPL

    $ cat /etc/apache2/sites-available/zesa
    <VirtualHost *:80>
    DocumentRoot /home/zesa/public_html
    ServerName 6a.nl
    ServerAlias *.6a.nl
    </VirtualHost>

    $ cat /home/zesa/public_html/.htaccess 
    RewriteCond %{HTTP_HOST} ^www.6a.nl$
    RewriteRule ^(.*) http://6a.nl/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} !^6a.nl$
    RewriteCond %{REQUEST_URI} !^/browse.php
    RewriteCond %{REQUEST_URI} !^/robots.txt$
    RewriteRule .* /browse.php [L]

    issues
    -certificate error (in IE even after install as root CA)
    -login in to gmail

    should be implemented
    -multipart/form-data (file upload)
    is implemented
    -cookies (should be optional?)
    -dns proxy
    -https (optional)
    -x-forwarded-for header (should be optional?)
    should (probably) not be implemented
    -crossdomain policy file
    -banner replacement (adsense) buss model?
    */

    function parse_headers($lines)
    $headers = array();
      while (
    count($lines)>0)
      { 
    $line trim(array_shift($lines));
        if (
    $line=='') break;
        
    $seppos strpos($line,':');
        
    $name trim(substr($line,0,$seppos));
        
    $value trim(substr($line,$seppos+1));
        if (
    $headers[$name])
        { if (!
    is_array($headers[$name]))
          { 
    $headers[$name] = array($headers[$name]);
          }
          
    array_push($headers[$name],$value);
        }
        else 
    $headers[$name]=$value;
      }
      return 
    $headers;
    }

    function 
    parse_chunked($chunked)
    $data '';
      
    $startpos 0;
      while (
    $startpos<strlen($chunked))
      { 
    $new_startpos strpos($chunked,"\r\n",$startpos)+2;
        
    $length hexdec(rtrim(substr($chunked$startpos$new_startpos-$startpos)));
        
    $data .= substr($chunked$new_startpos$length);
        
    $startpos $new_startpos $length;
      }
      return 
    $data;
    }

    function 
    get_request($method$host$url$data)
    $headers = array();
      
    array_push($headers$method.' '.$url.' HTTP/1.1');
      
    array_push($headers'Host: '.$host);
      
    array_push($headers'User-Agent: '.$_SERVER['HTTP_USER_AGENT']);
      if (
    $method=='POST')
      { 
    array_push($headers'Content-Type: '.$_SERVER['CONTENT_TYPE']);
        
    array_push($headers'Content-Length: '.$_SERVER['CONTENT_LENGTH']);
      }
      
    array_push($headers'Accept: '.$_SERVER['HTTP_ACCEPT']);
      
    array_push($headers'Accept-Language: '.$_SERVER['HTTP_ACCEPT_LANGUAGE']);
      
    array_push($headers'Accept-Charset: '.$_SERVER['HTTP_ACCEPT_CHARSET']);
      if (
    $_SERVER['HTTP_COOKIE']) array_push($headers'Cookie: '.$_SERVER['HTTP_COOKIE']);
      
    array_push($headers'Referer: '.$_SERVER['HTTP_REFERER']);
      
    $req_headers apache_request_headers();
      if (
    array_key_exists('X-Forwarded-For'$req_headers)) $forwarded_for=$req_headers['X-Forwarded-For'].', '.$_SERVER['REMOTE_ADDR'];
      else 
    $forwarded_for=$_SERVER['REMOTE_ADDR'];
      
    array_push($headers'X-Forwarded-For: '.$forwarded_for);
      
    array_push($headers'Connection: close');
      
    array_push($headers'');
      
    array_push($headers$data);
      return 
    join("\r\n",$headers);
    }

    function 
    log_txt($data)
    $log fopen('log.txt''a');
      
    fwrite($logdate(DATE_RFC822)." - ".$data."\n");
      
    fclose($log);
    }

    function 
    proxy($method,$url)
    $url parse_url($url);
      
    $scheme $url['scheme'];
      
    $host $url['host'];
      if (
    $url['port']) $port $url['port'];
      else 
    $port = ($scheme=='http'?80:443);
      
    $path $url['path'];
      
    $query $url['query'];
      if (
    $query$query='?'.$query;

      
    $data file_get_contents('php://input');
      
    $data get_request($method,$host,$path.$query,$data);
        
      
    $ip gethostbyname($host.'.');
      if (
    $ip==$host.'.') { echo "Could not resolve host '$host'"; exit; }
      
    $fp = @fsockopen(($scheme=='https'?'ssl://':'').$ip$port$errno$errstr5);
      if (
    $fp===false){ echo "$errno $errstr"; exit; }
      
    fwrite($fp,$data);
      
    /*weird bug*/ $old_errorlevel error_reporting(1);
      
    $data stream_get_contents($fp);
      
    /*weird bug*/ error_reporting($old_errorlevel);
      
    fclose($fp);

      
    $p strpos($data,"\r\n\r\n");
      
    $lines split("\r\n",substr($data,0,$p));
      
    $status trim(array_shift($lines));
      
    $headers parse_headers($lines);
      
      
    $data substr($data,$p+4);
      
    $transfer_encoding $headers['Transfer-Encoding'];
      if (
    $transfer_encoding=="chunked"$data parse_chunked($data);
      
      return array(
    'status'=>$status,'headers'=>$headers,'data'=>$data);
    }
     
    function 
    strends($string,$suffix)
    { return 
    substr($string,-1*strlen($suffix))==$suffix;
    }

    function 
    url_rewrite($matches)
    { if (
    $_COOKIE['dontcensorme_ssl']) $matches[1]='https';
      
    $url $matches[1].$matches[2].$matches[3];
      if (!
    strends($urlPROXY_SUFFIX)) $url.=PROXY_SUFFIX;
      return 
    $url;
    }

    function 
    domain_rewrite($matches)
    $url $matches[1].$matches[2].$matches[3];
      if (!
    strends($urlPROXY_SUFFIX)) $url.=PROXY_SUFFIX;
      return 
    $url;
    }

    function 
    rewrite($data)
    { return 
    preg_replace_callback('/(https?)(:\/\/)([0-9a-zA-Z\.\-]+)/','url_rewrite',$data);
    }

    function 
    rewrite_cookie($data)
    { return 
    preg_replace_callback('/(domain)(=)([0-9a-zA-Z\.\-]+)/i','domain_rewrite',$data);
    }

    $method trim(strtoupper($_SERVER['REQUEST_METHOD']));
    $scheme = ($_SERVER['HTTPS']?'https':'http');
    $host $_SERVER['HTTP_HOST'];
    $requri $_SERVER['REQUEST_URI'];
    if (
    $scheme=='http' && $_COOKIE['dontcensorme_ssl'])
    header('Location: https://'.$host.$requri);
    }
    if (
    $scheme=='https' && $_COOKIE['dontcensorme_ssl'])
    $scheme='http';
    }
    $newhost $host;
    if (
    strends($newhostPROXY_SUFFIX)) $newhost=substr($host,0,-1*strlen(PROXY_SUFFIX));

    if (
    '.'.$newhost==PROXY_SUFFIX || $newhost=='www')
    $newhost='www.google.com';
      
    $requri ='/';
    }
    $response proxy($method,$scheme.'://'.$newhost.$requri);
      
    $redirect_url trim($response['headers']['Location']);
    if (
    $redirect_url
    header('Location: '.rewrite($redirect_url));
    }
     
    $type $response['headers']['Content-Type'];
    $type strtolower(substr($type,0,strpos($type,'/')));

    if (
    $type=='text'$data rewrite($response['data']);
    else 
    $data $response['data'];

    header('Content-Type: '.$response['headers']['Content-Type']);
    if (
    $response['headers']['Set-Cookie'])
    $setcookie $response['headers']['Set-Cookie'];
      if (
    is_array($setcookie))
      { foreach (
    $setcookie as $cookie)
        { 
    header('Set-Cookie: '.rewrite_cookie($cookie), false);
        }
      }
      else 
    header('Set-Cookie: '.rewrite_cookie($response['headers']['Set-Cookie']));
    }

    echo 
    $data;
    //echo print_r($_SERVER);
    //echo print_r($response['headers']);
    ?>

  4. Thanked by:

    Kovich (15 July, 2011), WebEvader (15 July, 2011)

  5. #4
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    632
    Thanks
    192
    Thanked 104 Times in 82 Posts

    Corrections

    The code I previously posted doesn't seem to work on most servers. It gives the same error on each one I tested. I found a different version of Suffix Proxy that works MUCH better. I have a working example here: vectrosuffix.com

    Don't forget to set up a wildcard sudomain for *.yourdomain.com in both the DNS (using an A record) and Apache. The DocumentRoot for the wildcard in Apache should be the same directory where the script is.

    .htaccess code:

    Code:
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com$
    RewriteRule ^(.*) http://yourdomain.com/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} !^yourdomain.com$
    RewriteCond %{REQUEST_URI} !^/browse.php
    RewriteCond %{REQUEST_URI} !^/robots.txt$
    RewriteRule .* /browse.php [L]
    PHP code for browse.php (replace yourdomain.com on line 3 with your domain and make sure to keep the leading . in place.):

    PHP Code:
    <?php

    define
    ("PROXY_SUFFIX"".yourdomain.com"); // domain name suffix to reply for
    define("PROXY_HOME","www.google.com");
      
    /*

    // Author: Maurits van der Schee
    // License: GPL

    $ cat /etc/apache2/sites-available/username
    <VirtualHost *:80>
    DocumentRoot /home/username/public_html
    ServerName yourdomain.com
    ServerAlias *.yourdomain.com
    </VirtualHost>

    $ cat /home/username/public_html/.htaccess 
    RewriteCond %{HTTP_HOST} ^yourdomain.com$
    RewriteRule ^(.*) http://yourdomain.com/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} !^yourdomain.com$
    RewriteCond %{REQUEST_URI} !^/browse.php
    RewriteCond %{REQUEST_URI} !^/robots.txt$
    RewriteRule .* /browse.php [L]

    issues
    -certificate error (in IE even after install as root CA)
    -login in to gmail

    should be implemented
    -multipart/form-data (file upload)
    is implemented
    -cookies (should be optional?)
    -dns proxy
    -https (optional)
    -x-forwarded-for header (should be optional?)
    should (probably) not be implemented
    -crossdomain policy file
    -banner replacement (adsense) buss model?
    */

    function parse_headers($lines)
    $headers = array();
      while (
    count($lines)>0)
      { 
    $line trim(array_shift($lines));
        if (
    $line=='') break;
        
    $seppos strpos($line,':');
        
    $name trim(substr($line,0,$seppos));
        
    $value trim(substr($line,$seppos+1));
        if (
    $headers[$name])
        { if (!
    is_array($headers[$name]))
          { 
    $headers[$name] = array($headers[$name]);
          }
          
    array_push($headers[$name],$value);
        }
        else 
    $headers[$name]=$value;
      }
      return 
    $headers;
    }

    function 
    parse_chunked($chunked)
    $data '';
      
    $startpos 0;
      while (
    $startpos<strlen($chunked))
      { 
    $new_startpos strpos($chunked,"\r\n",$startpos)+2;
        
    $length hexdec(rtrim(substr($chunked$startpos$new_startpos-$startpos)));
        
    $data .= substr($chunked$new_startpos$length);
        
    $startpos $new_startpos $length;
      }
      return 
    $data;
    }

    function 
    get_request($method$host$url$data)
    $headers = array();
      
    array_push($headers$method.' '.$url.' HTTP/1.1');
      
    array_push($headers'Host: '.$host);
      
    array_push($headers'User-Agent: '.$_SERVER['HTTP_USER_AGENT']);
      if (
    $method=='POST')
      { 
    array_push($headers'Content-Type: '.$_SERVER['CONTENT_TYPE']);
        
    array_push($headers'Content-Length: '.$_SERVER['CONTENT_LENGTH']);
      }
      
    array_push($headers'Accept: '.$_SERVER['HTTP_ACCEPT']);
      
    array_push($headers'Accept-Language: '.$_SERVER['HTTP_ACCEPT_LANGUAGE']);
      
    array_push($headers'Accept-Charset: '.$_SERVER['HTTP_ACCEPT_CHARSET']);
      if (
    $_SERVER['HTTP_COOKIE']) array_push($headers'Cookie: '.$_SERVER['HTTP_COOKIE']);
      
    array_push($headers'Referer: '.$_SERVER['HTTP_REFERER']);
      
    //$req_headers = apache_request_headers();
      //if (array_key_exists('X-Forwarded-For', $req_headers)) $forwarded_for=$req_headers['X-Forwarded-For'].', '.$_SERVER['REMOTE_ADDR'];
      
    if ($_SERVER['HTTP_X-FORWARDED-FOR']) $forwarded_for=$_SERVER['HTTP_X-FORWARDED-FOR'].', '.$_SERVER['REMOTE_ADDR'];
      else 
    $forwarded_for=$_SERVER['REMOTE_ADDR'];
      
    array_push($headers'X-Forwarded-For: '.$forwarded_for);
      
    array_push($headers'Connection: close');
      
    array_push($headers'');
      
    array_push($headers$data);
      return 
    join("\r\n",$headers);
    }

    function 
    log_txt($data)
    $log fopen('log.txt''a');
      
    fwrite($logdate(DATE_RFC822)." - ".$data."\n");
      
    fclose($log);
    }

    function 
    proxy($method,$url)
    $url parse_url($url);
      
    $scheme $url['scheme'];
      
    $host $url['host'];
      if (
    $url['port']) $port $url['port'];
      else 
    $port = ($scheme=='http'?80:443);
      
    $path $url['path'];
      
    $query $url['query'];
      if (
    $query$query='?'.$query;

      
    $data file_get_contents('php://input');
      
    $data get_request($method,$host,$path.$query,$data);
        
      
    $ip gethostbyname($host.'.');
      if (
    $ip==$host.'.') { echo "Could not resolve host '$host'"; exit; }
      
    $fp = @fsockopen(($scheme=='https'?'ssl://':'').$ip$port$errno$errstr5);
      if (
    $fp===false){ echo "$errno $errstr"; exit; }
      
    fwrite($fp,$data);
      
    /*weird bug*/ $old_errorlevel error_reporting(1);
      
    $data stream_get_contents($fp);
      
    /*weird bug*/ error_reporting($old_errorlevel);
      
    fclose($fp);

      
    $p strpos($data,"\r\n\r\n");
      
    $lines split("\r\n",substr($data,0,$p));
      
    $status trim(array_shift($lines));
      
    $headers parse_headers($lines);
      
      
    $data substr($data,$p+4);
      
    $transfer_encoding $headers['Transfer-Encoding'];
      if (
    $transfer_encoding=="chunked"$data parse_chunked($data);
      
      return array(
    'status'=>$status,'headers'=>$headers,'data'=>$data);
    }
     
    function 
    strends($string,$suffix)
    { return 
    substr($string,-1*strlen($suffix))==$suffix;
    }

    function 
    add_warning($matches)
    { return 
    $matches[1].'<div style="z-index:9999;left:0;top:0;position:fixed;"><a href="#" style="text-decoration:none;font-family: sans-serif;font-weight:bold;font-size:12px;background-color:#770000;color:white;padding:2px;" onclick="this.style.visibility=\'hidden\';">Notice: You are visiting this site through the Proxy</a></div>';
    }

    function 
    url_rewrite($matches)
    { if (
    $_COOKIE['dontcensorme_ssl']) $matches[1]='https';
      
    $url $matches[1].$matches[2].$matches[3];
      if (!
    strends($urlPROXY_SUFFIX)) $url.=PROXY_SUFFIX;
      return 
    $url;
    }

    function 
    domain_rewrite($matches)
    $url $matches[1].$matches[2].$matches[3];
      if (!
    strends($urlPROXY_SUFFIX)) $url.=PROXY_SUFFIX;
      return 
    $url;
    }

    function 
    rewrite($data)
    $data preg_replace_callback('/(<body[^>]*>)/i','add_warning',$data);
      return 
    preg_replace_callback('/(https?)(:\/\/)([0-9a-zA-Z\.\-]+)/','url_rewrite',$data);
    }

    function 
    rewrite_cookie($data)
    { return 
    preg_replace_callback('/(domain)(=)([0-9a-zA-Z\.\-]+)/i','domain_rewrite',$data);
    }

    $method trim(strtoupper($_SERVER['REQUEST_METHOD']));
    $scheme = ($_SERVER['HTTPS']?'https':'http');
    $host $_SERVER['HTTP_HOST'];
    $requri $_SERVER['REQUEST_URI'];
    if (
    $scheme=='http' && $_COOKIE['dontcensorme_ssl'])
    header('Location: https://'.$host.$requri);
    }
    if (
    $scheme=='https' && $_COOKIE['dontcensorme_ssl'])
    $scheme='http';
    }
    $newhost $host;
    if (
    strends($newhostPROXY_SUFFIX)) $newhost=substr($host,0,-1*strlen(PROXY_SUFFIX));

    if (
    '.'.$newhost==PROXY_SUFFIX)
    header('Location: http://'.PROXY_HOME.PROXY_SUFFIX);
      exit;
    }
    $response proxy($method,$scheme.'://'.$newhost.$requri);
      
    $redirect_url trim($response['headers']['Location']);
    if (
    $redirect_url
    header('Location: '.rewrite($redirect_url));
    }
     
    $type $response['headers']['Content-Type'];
    $type strtolower(substr($type,0,strpos($type,'/')));

    if (
    $type=='text'$data rewrite($response['data']);
    else 
    $data $response['data'];

    header('Content-Type: '.$response['headers']['Content-Type']);
    if (
    $response['headers']['Set-Cookie'])
    $setcookie $response['headers']['Set-Cookie'];
      if (
    is_array($setcookie))
      { foreach (
    $setcookie as $cookie)
        { 
    header('Set-Cookie: '.rewrite_cookie($cookie), false);
        }
      }
      else 
    header('Set-Cookie: '.rewrite_cookie($response['headers']['Set-Cookie']));
    }

    echo 
    $data;
    //echo print_r($_SERVER);
    //echo print_r($response['headers']);
    ?>


    ---------- Post added at 19:12 PM ---------- Previous post was at 19:02 PM ----------

    Can anyone tell me what these lines in the source code do? I want to know if 'www.google.com' is the correct thing to put in that variable.

    PHP Code:
    define("PROXY_HOME","www.google.com"); 
    PHP Code:
    if ('.'.$newhost==PROXY_SUFFIX)
    header('Location: http://'.PROXY_HOME.PROXY_SUFFIX);
      exit;

    Also, does anyone know how to fix this so just this one URL (http://vectroproxy.com/pages/tunnel.php) does not get re-written by the proxy script? If so, then webmasters will be able to place a text link ad on proxied pages within Suffix Proxy. If anyone can fix it, I'll make a modified version of the script so webmasters can easily add their own text link ad.

    PHP Code:
    function add_warning($matches)
    { return 
    $matches[1].'<div style="z-index:9999;left:0;top:0;position:fixed;"><a href="#" style="text-decoration:none;font-family: sans-serif;font-weight:bold;font-size:12px;background-color:#770000;color:white;padding:2px;" onclick="this.style.visibility=\'hidden\';">Notice: You are visiting this site through the Proxy</a><br /><a href="#" style="text-decoration:none;font-family: sans-serif;font-weight:bold;font-size:12px;background-color:#770000;color:white;padding:2px;" onclick="location.href=\'http://vectroproxy.com/pages/tunnel.php\'">Click Here For Advanced Privacy and Unblocking Without Web-Based Scripts</a></div>';


  6. Thanked by:

    Will.Spencer (28 July, 2011)

  7. #5
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    632
    Thanks
    192
    Thanked 104 Times in 82 Posts
    Now that Suffix Proxy has been used on my server again and has been there for a while, I've had the chance to discover a weird side-effect. Facebook has already once mistaken Suffix Proxy as being a phishing site. They didn't understand it was a proxied connection to the real Facebook. When they looked at the URL they mistakenly thought it was copy site. Another company initiated a DMCA takedown request thinking their content had been copied, again not understanding that it was a proxied connection to their original content.

  8. #6
    ProxyHelp.org is offline Newbie Net Builder
    Join Date
    Jan 2011
    Posts
    62
    Thanks
    5
    Thanked 32 Times in 22 Posts
    i "THINK" this would fix google so it can search


    PHP Code:
    $data preg_match('action="/''action="'$url PROXY_SUFFIX '/'$data);
    echo 
    $data;
    ?> 
    for the end of the code

  9. Thanked by:

    vectro (13 September, 2011)

  10. #7
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    632
    Thanks
    192
    Thanked 104 Times in 82 Posts
    If the little bar in the upper left corner that says "You are viewing this page through a proxy" could just have a space underneath it for a text link or banner, then that would give webmasters a way to monetize this script. That might make it more popular. Right now it can't do much in the way of monetization.

  11. #8
    ProxyHelp.org is offline Newbie Net Builder
    Join Date
    Jan 2011
    Posts
    62
    Thanks
    5
    Thanked 32 Times in 22 Posts
    Thought id make a post hear, Vectro set me up with some hosting, and i have been working on this script.
    you can check out betas at testproxy.tk
    if any one has some ideas for this let me know.

  12. Thanked by:

    vectro (15 September, 2011)

  13. #9
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    632
    Thanks
    192
    Thanked 104 Times in 82 Posts
    Quote Originally Posted by ProxyHelp.org View Post
    i have been working on this script.
    Please post code here and update us with progress as you go along and make changes.

    ---------- Post added at 13:36 PM ---------- Previous post was at 13:28 PM ----------

    Quote Originally Posted by ProxyHelp.org View Post
    Thought id make a post hear, Vectro set me up with some hosting, and i have been working on this script.
    you can check out betas at testproxy.tk
    if any one has some ideas for this let me know.
    The address bar on testproxy.tk looks nice so far. You could make an admin panel (as you mentioned to me previously), especially if it has an option for restricting specific URLs. The blue bar that says "Your useing a BETA! Proxy" should always be on top like in the original Suffix Proxy script. Yours seems to end up buried behind some elements at the top of some web pages. Then after you force it to always be on top, have an ad space available. That will be the biggest thing to get more webmasters to use it. Right now there's no real way to monetize it.

  14. #10
    ProxyHelp.org is offline Newbie Net Builder
    Join Date
    Jan 2011
    Posts
    62
    Thanks
    5
    Thanked 32 Times in 22 Posts
    This is my current code

    index.php



    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title>index.php</title>
    </head><body><div style="text-align: center;"><big><big><big><big>Beta <span style="font-family: arial,helvetica,sans-serif;"></span>Suffix Proxy</big></big></big></big><br><form method="post" action="/browse.php">      <p id="address_bar"><label>Web Address <input id="address_box" type="text" name="" value="google.com" onfocus="this.select()" /></label> <input id="go" type="submit" value="Go" /></p><!-- I ask you keep this, or donate. --><script type="text/javascript"><!--google_ad_client = "pub-3402075004633034";/* ProxyHelp Script */google_ad_slot = "6505751312";google_ad_width = 468;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></form><br><br></span><span style="font-weight: bold;"><span style="font-weight: bold;">Hostedby </span></span><span style="font-weight: bold; text-decoration: underline;"></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px;"></span></span></div>
    <div style="text-align: center;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px;"><b style=""><a href="http://www.xproxyhost.com/" target="_blank" style="color: rgb(88, 124, 29); text-decoration: none; outline-width: 0px;">xProxy Host - Proxy Hosting With GeoIP and cPanel</a><br style=""><br style=""><a href="http://www.xproxylist.com/" target="_blank" style="color: rgb(3, 92, 159); text-decoration: none;">x Proxy List -List Your Proxy Site</a><br style=""><br style=""><a href="http://vectroproxy.com/pages/tunnel.php" target="_blank" style="color: rgb(3, 92, 159); text-decoration: none;">VectroTunnelAdvanced SSH Tunnel Proxy</a><br><br><br><br><br><br><a href="http://JeffsSite.us" target="_blank" style="color: rgb(30, 92, 159); text-decoration: none;">Codeing of this Script is by, JeffsSite.us (proxyhelp.org) </a><br><br><br><br><br><script type="text/javascript" src="http://ajax.cloudflare.com/cdn-cgi/scripts/cf_status.js"></script><a href="http://www.cloudflare.com" style="display: block; position: relative; width: 0px; height: 0px;"><img src="http://ajax.cloudflare.com/cdn-cgi/images/seal/standard/0x0.png" style="border: 0pt none ; position: absolute; clip: rect(0px, 0px, 0px, 0px);" onload="try{window.__CF.checkStatus(this)}catch(e){}"></a></b></span></span></div>
    </body></html>
    browse.php
    PHP Code:
    <?php
    define
    ("PROXY_SUFFIX"".testproxy.tk"); // domain name suffix to reply fordefine("PROXY_HOME","www.google.com"); // if user enters above domain as proxy site, send them to...$ads1 = 'Your viewing this useing a beta proxy';/*// Author: Maurits van der Schee// Editor: Jeffery Schefke JeffsSite.us// License: GPL// */
    function parse_headers($lines){ $headers = array();  while (count($lines)>0)  { $line trim(array_shift($lines));    if ($line=='') break;    $seppos strpos($line,':');    $name trim(substr($line,0,$seppos));    $value trim(substr($line,$seppos+1));    if ($headers[$name])    { if (!is_array($headers[$name]))      { $headers[$name] = array($headers[$name]);      }      array_push($headers[$name],$value);    }    else $headers[$name]=$value;  }  return $headers;}
    function 
    parse_chunked($chunked){ $data '';  $startpos 0;  while ($startpos<strlen($chunked))  { $new_startpos strpos($chunked,"\r\n",$startpos)+2;    $length hexdec(rtrim(substr($chunked$startpos$new_startpos-$startpos)));    $data .= substr($chunked$new_startpos$length);    $startpos $new_startpos $length;  }  return $data;}
    function 
    get_request($method$host$url$data){ $headers = array();  array_push($headers$method.' '.$url.' HTTP/1.1');  array_push($headers'Host: '.$host);  array_push($headers'User-Agent: '.$_SERVER['HTTP_USER_AGENT']);  if ($method=='POST')  { array_push($headers'Content-Type: '.$_SERVER['CONTENT_TYPE']);    array_push($headers'Content-Length: '.$_SERVER['CONTENT_LENGTH']);  }  array_push($headers'Accept: '.$_SERVER['HTTP_ACCEPT']);  array_push($headers'Accept-Language: '.$_SERVER['HTTP_ACCEPT_LANGUAGE']);  array_push($headers'Accept-Charset: '.$_SERVER['HTTP_ACCEPT_CHARSET']);  if ($_SERVER['HTTP_COOKIE']) array_push($headers'Cookie: '.$_SERVER['HTTP_COOKIE']);  array_push($headers'Referer: '.$_SERVER['HTTP_REFERER']);  if ($_SERVER['HTTP_X-FORWARDED-FOR']) $forwarded_for=$_SERVER['HTTP_X-FORWARDED-FOR'].', '.$_SERVER['REMOTE_ADDR'];  else $forwarded_for=$_SERVER['REMOTE_ADDR'];  array_push($headers'X-Forwarded-For: '.$forwarded_for);  array_push($headers'Connection: close');  array_push($headers'');  array_push($headers$data);  return join("\r\n",$headers);}
    function 
    log_txt($data){ $log fopen('log.txt''a');  fwrite($logdate(DATE_RFC822)." - ".$data."\n");  fclose($log);}
    function 
    proxy($method,$url){ $url parse_url($url);  $scheme $url['scheme'];  $host $url['host'];  if ($url['port']) $port $url['port'];  else $port = ($scheme=='http'?80:443);  $path $url['path'];  $query $url['query'];  if ($query$query='?'.$query;
      
    $data file_get_contents('php://input');  $data get_request($method,$host,$path.$query,$data);      $ip gethostbyname($host.'.');  if ($ip==$host.'.') { echo "Could not resolve host '$host'"; exit; }  $fp = @fsockopen(($scheme=='https'?'ssl://':'').$ip$port$errno$errstr5);  if ($fp===false){ echo "$errno $errstr"; exit; }  fwrite($fp,$data);  /*weird bug*/ $old_errorlevel error_reporting(1);  $data stream_get_contents($fp);  /*weird bug*/ error_reporting($old_errorlevel);  fclose($fp);
      
    $p strpos($data,"\r\n\r\n");  $lines split("\r\n",substr($data,0,$p));  $status trim(array_shift($lines));  $headers parse_headers($lines);    $data substr($data,$p+4);  $transfer_encoding $headers['Transfer-Encoding'];  if ($transfer_encoding=="chunked"$data parse_chunked($data);    return array('status'=>$status,'headers'=>$headers,'data'=>$data);} function strends($string,$suffix){ return substr($string,-1*strlen($suffix))==$suffix;}$makeroom '<style type="text/css"> html body { margin-top: 80px; } </style>';
    function 
    add_warning($matches){ return $matches[1].$makeroom.'<div style="width:100%;margin:0;text-align:center;border-bottom:1px solid #725554;color:#000000;background-color:#F2FDF3;font-size:12px;font-weight:bold;font-family:Bitstream Vera Sans,arial,sans-serif;padding:4px;"><img src="ubuntu.png" alt="Ubuntu.com" /><BR> Your useing a BETA! Proxy</div>';}
    function 
    url_rewrite($matches){ if ($_COOKIE['dontcensorme_ssl']) $matches[1]='https';  $url $matches[1].$matches[2].$matches[3];  if (!strends($urlPROXY_SUFFIX)) $url.=PROXY_SUFFIX;  return $url;}
    function 
    domain_rewrite($matches){ $url $matches[1].$matches[2].$matches[3];  if (!strends($urlPROXY_SUFFIX)) $url.=PROXY_SUFFIX;  return $url;}
    function 
    rewrite($data){ $data preg_replace_callback('/(<body[^>]*>)/i','add_warning',$data);  return preg_replace_callback('/(https?)(:\/\/)([0-9a-zA-Z\.\-]+)/','url_rewrite',$data);}
    function 
    rewrite_cookie($data){ return preg_replace_callback('/(domain)(=)([0-9a-zA-Z\.\-]+)/i','domain_rewrite',$data);}
    $method trim(strtoupper($_SERVER['REQUEST_METHOD']));$scheme = ($_SERVER['HTTPS']?'https':'http');$host $_SERVER['HTTP_HOST'];$requri $_SERVER['REQUEST_URI'];if ($scheme=='http' && $_COOKIE['dontcensorme_ssl']){ header('Location: https://'.$host.$requri);}if ($scheme=='https' && $_COOKIE['dontcensorme_ssl']){ $scheme='http';}$newhost $host;if (strends($newhostPROXY_SUFFIX)) $newhost=substr($host,0,-1*strlen(PROXY_SUFFIX));
    if (
    '.'.$newhost==PROXY_SUFFIX){ header('Location: http://'.PROXY_HOME.PROXY_SUFFIX);  exit;}$response proxy($method,$scheme.'://'.$newhost.$requri);  $redirect_url trim($response['headers']['Location']);if ($redirect_url) { header('Location: '.rewrite($redirect_url));} $type $response['headers']['Content-Type'];$type strtolower(substr($type,0,strpos($type,'/')));
    if (
    $type=='text'$data rewrite($response['data']);else $data $response['data'];
    header('Content-Type: '.$response['headers']['Content-Type']);if ($response['headers']['Set-Cookie']){ $setcookie $response['headers']['Set-Cookie'];  if (is_array($setcookie))  { foreach ($setcookie as $cookie)    { header('Set-Cookie: '.rewrite_cookie($cookie), false);    }  }  else header('Set-Cookie: '.rewrite_cookie($response['headers']['Set-Cookie']));}echo $data;?>
    Thats my current quick codeing.

  15. Thanked by:

    vectro (16 September, 2011)

Page 1 of 6 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •