// >

"> ~~~~~ Bypass Web Filters
The only Bypass Web Filter Site without the "P****" word /contact.php">

Subscribe to our Daily list of new Proxies


">About Us

Browse the internet in complete Anonymity using "> . You can Bypass Web Filters on sites such as MySpace, Bebo, Facebook, YouTube, Orkut, Friendster and many other sites completely Anonymously. Feel free to Bypass Filters 24/7 and we will safeguard your online presence!

">About Bypassing In General

Web Filters are commonly used for several reasons: security, censorship or filtering. Filtering websties (such as us) insulate you from objectionable elements of Webpages such as cookies, ad banners, dynamic content like Javascript, Java Applets and ActiveX controls. Some anonymous bypass web filters encrypt your Web communications, protecting you from routine monitoring or even dedicated surveillance. Be careful, though, not all filters are anonymous unlike !

style="display: none">>
URL:  
Tunnel Proxy:
  
User-Agent:
 /> Persistent URL Form
 /> Remove Cookies
 /> Remove Referer Field
 /> Remove Scripts (JS, VBS, etc)
 /> Remove Objects (Flash, Java, etc)
 /> Encrypt URLs
 /> Encrypt Cookies
Links
A81 Bypass Web Filter Network
Bingo.us.to Bypass Network
Topsites
<?php echo $pageURL; ?> || Bypass Web Filters
 Surrogafier    
WidgetBucks - Trend Watch - WidgetBucks.com
// ]*)'; $htmlnoquotnoqm='(?:[^\?"\'\\\\][^\?> ]*)'; $htmlreg="({$quoteseg}|{$htmlnoquot}))"; $xmlhttpreq="(?:XMLHttpRequest{$anyspace}(?:\({$anyspace}\)|)|ActiveXObject{$anyspace}\({$anyspace}[^\)]+\.XMLHTTP['\"]{$anyspace}\))(?=;)"; $jsnewobj="(?:{$anyspace}new{$plusspace}|{$anyspace})"; $formnotpost="(?:(?!method{$anyspace}={$anyspace}(?:'|\")?post)[^>])"; $frametargets='_(?:top|parent|self)'; $js_string_methods='(?:anchor|big|blink|bold|charAt|charCodeAt|concat|fixed|fontcolor|fontsize|fromCharCode|indexOf|italics|lastIndexOf|link|match|replace|search|slice|small|split|strike|sub|substr|substring|sup|toLowerCase|toUpperCase|toSource|valueOf)'; $js_string_attrs='(?:constructor|length|prototype)'; # }}} # REGEXPS: JAVASCRIPT PARSING {{{ $js_regexp_arrays=array( array(1,2,"/{$jsbegin}({$jsvarobj})\.({$jshookgetattrs}){$anyspace}\+=/i",'\1\2.\3='.COOK_PREF.'.getAttr(\2,/\3/)+'), array(1,2,"/{$jsbegin}({$jsvarobj})\.(({$jshookattrs}){$anyspace}=(?:{$anyspace}{$jsvarobj}{$anyspace}=)*{$anyspace})((?!\=)({$notjsend}.)*){$jsend}/i",'\1'.COOK_PREF.'.setAttr(\2,/\4/,\5)'), array(1,2,"/{$jsbeginright}({$jsvarobj})\.({$jshookgetattrs})([^\.=a-z0-9_\[\]\t\r\n]|\.{$js_string_methods}\(|\.{$js_string_attrs}{$notjsvarsect})/i",'\1'.COOK_PREF.'.getAttr(\2,/\3/)\4'), array(1,2,"/([^a-z0-9]{$jsmethods}{$anyspace}\()([^)]*)\)/i",'\1'.COOK_PREF.'.surrogafy_url(\3))'), array(1,2,"/([^a-z0-9])eval{$anyspace}\(({$anyspace}{$jsvarobj})\)/i",'\1eval('.COOK_PREF.'.parse_all_html(\2,"application/x-javascript"))'), array(1,2,"/{$jsbegin}\.action{$anyspace}=/i",'\1.'.COOK_PREF.'.value='), //array(1,2,"/{$jsbegin}(\.setAttribute{$anyspace}\({$anyspace}(\"|')({$jsattrs})(\\2){$anyspace},{$anyspace})(.*?){$jsend}/i",'\1\2'.COOK_PREF.'.surrogafy_url(\6)'), //array(1,2,"/{$jsbegin}(\.setAttribute{$anyspace}\({$anyspace}(\"|')({$jsattrs})(\\2){$anyspace},{$anyspace})(.*?){$jsend}/i",'\1\2'.COOK_PREF.'.surrogafy_url(\6)'), array(1,2,"/{$jsbegin}({$jsvarobj})\.setAttribute{$anyspace}\({$anyspace}({$jsquotereg}){$anyspace},{$anyspace}({$jsquotereg}){$anyspace}\)/i",'\1'.COOK_PREF.'.setAttr(\2,\3,\4)'), array(1,2,"/{$jsbegin}([^\ {>\t\r\n=;]+{$anyspace}=)({$jsnewobj}{$xmlhttpreq})/i",'\1\2'.COOK_PREF.'.XMLHttpRequest_wrap(\3)'), array(1,2,"/{$jsbegin}(return{$plusspace})({$jsnewobj}{$xmlhttpreq})/i",'\1\2'.COOK_PREF.'.XMLHttpRequest_wrap(\3)'), (ENCRYPT_URLS?array(1,2,"/{$jsbegin}((?:[^\) \{\}]*(?:\)\.{0,1}))+)(\.submit{$anyspace}\(\)){$jsend}/i",'\1void((\2.method=="post"?null:\2\3));'):null), ); # }}} # REGEXPS: HTML/CSS PARSING {{{ $regexp_arrays=array( 'text/html' => array( ## do HTML based javascript stuff # OLDWAY #array(1,1,"/( on[a-z]{3,20}{$anyspace}={$anyspace})(?:(\")([^\"]+)(\")|(')([^']+)('))/i",'\1\2\5;\3\6;\4\7'), # OLDWAY #array(1,2,"/(])*)>)([\s\S]*?)(?:{$anyspace}(?:\/\/)?{$anyspace}-->{$anyspace})?<\/script>/i",'\1\2;'.COOK_PREF.'.purge();//-->'), # OLDWAY # target attr (PAGETYPE_ID===PAGETYPE_FRAMED_PAGE?array(1,1,"/(<[a-z][^>]*{$anyspace}) target{$anyspace}={$anyspace}(?:{$frametargets}|('){$frametargets}'|(\"){$frametargets}\")/i",'\1'):null), (PAGETYPE_ID===PAGETYPE_FRAMED_CHILD?array(1,1,"/(<[a-z][^>]*{$anyspace} target{$anyspace}={$anyspace})(?:_top|(')_top'|(\")_top\")/i",'\1\2\3'.COOK_PREF.'_top\2\3'):null), # deal with
s array(1,1,"/(/i",'\1\3>'), array(2,1,"//i",1,false), array(1,1,'/(]*?)>/i','\1 target="_self"'.(ENCRYPT_URLS?' onsubmit="return '.COOK_PREF.'.form_encrypt(this);">':'>')), array(1,1,"/((?!)/i','\1 target="_parent">'), # deal with the form button for encrypted URLs (ENCRYPT_URLS?array(1,1,"/(]*? type{$anyspace}={$anyspace}(?:\"submit\"|'submit'|submit)[^>]*?[^\/])((?:[ ]?[\/])?>)/i",'\1 onclick="'.COOK_PREF.'_form_button=this.name;"\2'):null), # parse all the other tags array(2,1,"/<[a-z][^>]*{$plusspace}{$htmlattrs}{$anyspace}={$anyspace}{$htmlreg}/i",2), array(2,1,"/]*{$plusspace}name{$anyspace}={$anyspace}[\"']?movie[^>]*{$plusspace}value{$anyspace}={$anyspace}{$htmlreg}/i",1), array(2,2,"/]*?{$plusspace}src{$anyspace}={$anyspace}([\"']){$anyspace}(.*?[^\\\\])\\1[^>]*>{$anyspace}<\/script>/i",2), (URL_FORM && PAGE_FRAMED?array(2,1,"/]*href{$anyspace}={$anyspace}{$htmlreg}/i",1,false,NEW_PAGETYPE_FRAME_TOP):null), (URL_FORM && PAGE_FRAMED?array(2,1,"/<[i]?frame{$plusspace}[^>]*src{$anyspace}={$anyspace}{$htmlreg}/i",1,false,PAGETYPE_FRAMED_CHILD):null) ), 'text/css' => array( array(2,1,"/[^a-z]url\({$anyspace}(&(?:quot|#(?:3[49]));|\"|')(.*?[^\\\\])(\\1){$anyspace}\)/i",2), array(2,1,"/[^a-z]url\({$anyspace}((?!&(?:quot|#(?:3[49]));)[^\"'\\\\].*?[^\\\\]){$anyspace}\)/i",1), array(2,1,"/@import{$plusspace}(&(?:quot|#(?:3[49]));|\"|')(.*?[^\\\\])(\\1);/i",2) ), 'application/x-javascript' => $js_regexp_arrays, 'text/javascript' => $js_regexp_arrays ); # }}} # REGEXPS: INSERT JAVASCRIPT REGEXPS {{{ if(QUERY_STRING=='js_regexps' || QUERY_STRING=='js_regexps_framed'){ ?>//]*{$plusspace}http-equiv{$anyspace}={$anyspace}([\"']|)refresh\\1[^>]* content{$anyspace}={$anyspace}([\"']|)[ 0-9\.;\t\\r\n]*url=(.*?)\\2[^>]*>/i",3,true,NEW_PAGETYPE_FRAMED_PAGE), array(1,1,"/(]*{$plusspace}http-equiv{$anyspace}={$anyspace}([\"']|)set-cookie\\2[^>]* content{$anyspace}={$anyspace})([\"'])(.*?[^\\\\]){$anyspace}\\3/i",'\1\3'.PAGECOOK_PREFIX.'\4\3') ); # }}} # REGEXPS: CLEANUP {{{ # needed later, but $anyspace and $htmlreg are unset below define('BASE_REGEXP',"]* href{$anyspace}={$anyspace}{$htmlreg}[^>]*>"); define('END_OF_SCRIPT_TAG',"(?:{$anyspace}(?:\/\/)?{$anyspace}-->{$anyspace})?<\/script>"); define('REGEXP_SCRIPT_ONEVENT',"( on[a-z]{3,20}=(?:\"[^\"]+\"|'[^']+'|[^\"' >][^ >]+[^\"' >])| href=(?:\"{$anyspace}javascript:[^\"]+\"|'{$anyspace}javascript:[^']+'|{$anyspace}javascript:[^\"' >][^ >]+[^\"' >]))"); unset($jsattrs,$jshookattrs,$jsmethods,$jslochost,$htmlattrs, $anyspace,$plusspace,$operands,$notoperands, $quoteseg,$regseg, $jsvarsect,$jsobjsect,$jsvarobj,$jsquotesect,$jsquotereg, $notjsvarsect, $jsend,$notjsend,$jsbegin,$jsbeginright, $htmlnoquot,$htmlnoquotnoqm,$htmlreg,$xmlhttpreq,$jsnewobj,$formnotpost,$frametargets, $js_string_methods,$js_string_attrs, $js_regexp_arrays ); # }}} # }}} # PROXY FUNCTIONS {{{ # PROXY FUNCTIONS: AURL CLASS {{{ # class for URL class aurl{ var $url,$topurl,$locked; var $proto,$userpass,$servername,$portval,$path,$file,$query,$label; function aurl($url,$topurl=null){ if(strlen($url)>MAXIMUM_URL_LENGTH) $this->url=null; else $this->url=preg_replace('/&#([0-9]+);/e','chr(\1)',trim(str_replace('&','&',str_replace(chr(13),null,str_replace(chr(10),null,$url))))); $this->topurl=$topurl; $this->determine_locked(); if($this->locked) return; $urlwasvalid=true; if(!preg_match(URLREG,$this->url)){ $urlwasvalid=false; if($this->topurl==null) $this->url='http://'.(($this->url{0}==':' || $this->url{0}=='/')?substr($this->url,1):$this->url).(strpos($this->url,'/')!==false?null:'/'); #if($this->topurl==null) $this->url='http://'.preg_replace("/^:?\/{0,2}/","",$this->url).(strpos($this->url,'/')!==false?null:'/'); else{ $newurl=$this->topurl->get_proto().$this->get_fieldreq(2,$this->topurl->get_userpass()).$this->topurl->get_servername().(($this->topurl->get_portval()!=80 && ($this->topurl->get_proto()=='https'?$this->topurl->get_portval()!=443:true))?':'.$this->topurl->get_portval():null); if($this->url{0}!='/') $newurl.=$this->topurl->get_path(); $this->url=$newurl.$this->url; } } $this->set_proto(($urlwasvalid || $this->topurl==null?preg_replace('/^([^:\/]*).*$/','\1',$this->url):$this->topurl->get_proto())); $this->set_userpass(preg_replace(URLREG,'\2',$this->url)); $this->set_servername(preg_replace(URLREG,'\3',$this->url)); $this->set_portval(preg_replace(URLREG,'\4',$this->url)); $this->set_path(preg_replace(URLREG,'\5',$this->url)); $this->set_file(preg_replace(URLREG,'\6',$this->url)); $this->set_query(preg_replace(URLREG,'\7',$this->url)); $this->set_label(preg_replace(URLREG,'\8',$this->url)); if(!$this->locked && !preg_match(URLREG,$this->url)) havok(7,$this->url); #* } function determine_locked(){ $this->locked=preg_match(AURL_LOCK_REGEXP,$this->url)>0; } #* function get_fieldreq($fieldno,$value){ $fieldreqs=array(2 => '://'.($value!=null?"$value@":null), 4 => ($value!=null && intval($value)!=80?':'.intval($value):null), 7 => ($value!=null?"?$value":null), 8 => ($value!=null?"#$value":null)); if(!array_key_exists($fieldno,$fieldreqs)) return (empty($value)?null:$value); else return $fieldreqs[$fieldno]; } function set_proto($proto=''){ if($this->locked) return; $this->proto=(!empty($proto)?$proto:'http'); } function get_proto(){ return $this->proto; } function get_userpass(){ return $this->userpass; } function set_userpass($userpass=null){ $this->userpass=$userpass; } function get_servername(){ return $this->servername; } function set_servername($servername=null){ $this->servername=$servername; } function get_portval(){ return (empty($this->portval)?($this->get_proto()=='https'?'443':'80'):$this->portval); } function set_portval($port=null){ $this->portval=strval((intval($port)!=80)?$port:null); } function get_path(){ if(strpos($this->path,'/../')!==false) $this->path=preg_replace('/(?:\/[^\/]+){0,1}\/\.\.\//','/',$this->path); if(strpos($this->path,'/./')!==false) while(($path=str_replace('/./','/',$this->path)) && $path!=$this->path) $this->path=$path; return $this->path; } function set_path($path=null){ $this->path=(empty($path)?'/':$path); } function get_file(){ return $this->file; } function set_file($file=null){ $this->file=$file; } function get_query(){ return $this->query; } function set_query($query=null){ $this->query=$query; } function get_label(){ return $this->label; } function set_label($label=null){ $this->label=$label; } function get_url($withlabel=true){ if($this->locked) return $this->url; return $this->get_proto().'://'. ($this->get_userpass()==null?null:$this->get_userpass().'@'). $this->get_servername(). (($this->get_proto()=='https' && intval($this->get_portval())==443) || intval($this->get_portval())==80?null:':'.intval($this->get_portval())). $this->get_path().$this->get_file(). ($this->get_query()==null?null:'?'.$this->get_query()). ($withlabel && $this->get_label()==null?null:'#'.$this->get_label()) ; } function surrogafy(){ $label=$this->get_label(); $this->set_label(); $url=$this->get_url(); $this->set_label($label); #$this->determine_locked(); if($this->locked) return $url; # || $this->get_proto().$this->get_fieldreq(2,$this->get_userpass()).$this->get_servername().$this->get_path().$this->get_file()==THIS_SCRIPT) return $url; if(ENCRYPT_URLS && !$this->locked) $url=proxenc($url); #$url=THIS_SCRIPT.'?='.(!ENCRYPT_URLS?urlencode($url):$url).(!empty($label)?"#$label":null); # urlencoded $url=THIS_SCRIPT."?={$url}".(!empty($label)?"#$label":null); return $url; } } # }}} # PROXY FUNCTIONS: URL PARSING {{{ function surrogafy_url($url,$topurl=false,$addproxy=true){ global $curr_urlobj; //if(preg_match('/^(["\']).*\1$/is',$url)>0){ if(($url{0}=='"' && substr($url,-1)=='"') || ($url{0}=='\'' && substr($url,-1)=='\'')){ $urlquote=$url{0}; $url=substr($url,1,strlen($url)-2); } if($topurl===false) $topurl=$curr_urlobj; $urlobj=new aurl($url,$topurl); $new_url=($addproxy?$urlobj->surrogafy():$urlobj->get_url()); if(!empty($urlquote)) $new_url="{$urlquote}{$new_url}{$urlquote}"; return $new_url; } function framify_url($url,$frame_type=false){ if(($frame_type!==PAGETYPE_FRAME_TOP || !URL_FORM) && ($frame_type!==PAGETYPE_FRAMED_PAGE && !PAGE_FRAMED)) return $url; //if(preg_match('/^(["\']).*\1$/is',$url)>0){ if(($url{0}=='"' && substr($url,-1)=='"') || ($url{0}=='\'' && substr($url,-1)=='\'')){ $urlquote=$url{0}; $url=substr($url,1,strlen($url)-2); } if(preg_match(FRAME_LOCK_REGEXP,$url)<=0){ if($frame_type===PAGETYPE_FRAME_TOP && URL_FORM) $query='&='; elseif($frame_type===PAGETYPE_FRAMED_CHILD) $query='.&='; elseif($frame_type===PAGETYPE_FRAMED_PAGE || PAGE_FRAMED) $query='_&='; else $query=null; $url=preg_replace('/^([^\?]*)[\?]?'.PAGETYPE_MINIREGEXP.'([^#]*?[#]?.*?)$/',"\\1?={$query}\\3",$url,1); } if(!empty($urlquote)) $url="{$urlquote}{$url}{$urlquote}"; return $url; } function proxenc($url){ if($url{0}=='~' || strtolower(substr($url,0,3))=='%7e') return $url; $url=urlencode($url); $new_url=null; for($i=0;$i126) $char-=94; $new_url.=chr($char); } #return '~'.base64_encode($new_url); return '~'.urlencode(base64_encode($new_url)); } # }}} # PROXY FUNCTIONS: ERRORS & EXITING {{{ function finish_noexit(){ global $dns_cache_array; # save DNS Cache before exiting $_SESSION['DNS_CACHE_ARRAY']=$dns_cache_array; } function finish(){ finish_noexit(); exit(); } function havok($errorno,$arg1=null,$arg2=null,$arg3=null){ global $curr_url; $url=$curr_url; switch($errorno){ case 1: $et='Bad IP Address'; $ed="The IP address given ({$arg2}) is an impossible IP address, or the domain given ({$arg1}) was resolved to an impossible IP address."; break; case 2: $et='Address is Blocked'; $ed="The administrator of this proxy service has decided to block this address, domain, or subnet.\n

\nDomain: {$arg1}\n
\nAddress: {$arg2}"; break; case 3: $et='Could Not Resolve Domain'; $ed="The domain of the URL given ({$arg1}) could not be resolved due to DNS issues or an errorneous domain name."; break; case 4: $et='Bad Filters'; $ed='The administrator of this proxy has incorrectly configured his domain filters, or a domain given could not be resolved.'; break; case 5: $et='Domain is Blocked'; $ed='The administrator of this proxy has decided to block this domain.'; break; case 6: $et='Could Not Connect to Server'; $ed="An error has occurred while attempting to connect to \"{$arg1}\" on port \"{$arg2}\"."; break; case 7: $et='Invalid URL'; $ed='The URL below was detected to be an invalid URL.'; $url=$arg1; break; } $ed.="\n

\nURL: {$url}"; ?>
!
Error:
time(), 'ipaddr'=>$ipaddr); return $ipaddr; } function gethostbyname_cached($address){ global $dns_cache_array; if(isset($dns_cache_array[$address])) return $dns_cache_array[$address]['ipaddr']; return gethostbyname_cacheit($address); } function get_check($address){ global $blocked_addresses; if(strrchr($address,'/')) $address=substr(strrchr($address,'/'),1); $ipc=ip_check($address); $addressip=(ip_check($address)?$address:gethostbyname_cached($address)); if(!ip_check($addressip)) havok(1,$address,$addressip); foreach($blocked_addresses as $badd){ if(!$ipc) if(strlen($badd)<=strlen($address) && substr($address,strlen($address)-strlen($badd),strlen($badd))==$badd) havok(5); if($badd==$addressip) havok(2,$address,$addressip); elseif(ip_check($badd,true)){ if(ipcompare($badd,$addressip)) havok(2,$address,$addressip); } else{ $baddip=gethostbyname_cached($badd); if(empty($baddip)) havok(4); if($baddip==$addressip) havok(2,$address,$addressip); } } return $addressip; } # }}} # PROXY FUNCTIONS: HTTP {{{ function httpclean($str){ return str_replace(' ','+',preg_replace('/([^":\-_\.0-9a-z ])/ie','\'%\'.(strlen(dechex(ord(\'\1\')))==1?\'0\':null).strtoupper(dechex(ord(\'\1\')))',$str)); } function getpage($url){ global $headers,$out,$post_vars,$proxy_variables,$referer; $urlobj=new aurl($url); $query=$urlobj->get_query(); $requrl=$urlobj->get_path().$urlobj->get_file().(!empty($query)?"?{$query}":null); $http_auth=null; if(extension_loaded('apache')){ $fail=false; $cheaders=getallheaders(); $http_auth=$reqarray['Authorization']; } else $fail=true; $authorization=($fail?$_SERVER['HTTP_AUTHORIZATION']:$cheaders['Authorization']); $cache_control=($fail?$_SERVER['HTTP_CACHE_CONTROL']:$cheaders['Cache-Control']); $if_modified=($fail?$_SERVER['HTTP_IF_MODIFIED_SINCE']:$cheaders['If-Modified-Since']); $if_none_match=($fail?$_SERVER['HTTP_IF_NONE_MATCH']:$cheaders['If-None-Match']); if($fail){ if(!empty($authorization)) $http_auth=$authorization; elseif(!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) $http_auth='Basic '.base64_encode("{$_SERVER['PHP_AUTH_USER']}:{$_SERVER['PHP_AUTH_PW']}"); elseif(!empty($_SERVER['PHP_AUTH_DIGEST'])) $http_auth="Digest {$_SERVER['PHP_AUTH_DIGEST']}"; } if(PIP!=null && PPORT!=null){ $servername=PIP; $ipaddress=get_check(PIP); $portval=PPORT; $requrl=$urlobj->get_url(false); } else{ $servername=$urlobj->get_servername(); $ipaddress=($urlobj->get_proto()=='ssl' || $urlobj->get_proto()=='https'?'ssl://':null).get_check($servername); $portval=$urlobj->get_portval(); } $out="{$_SERVER['REQUEST_METHOD']} ".str_replace(' ','%20',$requrl)." HTTP/1.1\r\nHost: ".$urlobj->get_servername().(($portval!=80 && ($urlobj->get_proto()=='https'?$portval!=443:true))?":$portval":null)."\r\n"; global $useragent; $useragent=null; if($_COOKIE[COOK_PREF.'_useragent']!='-1'){ $useragent=$_COOKIE[COOK_PREF.'_useragent']; if(empty($useragent)) $useragent=$_SERVER['HTTP_USER_AGENT']; $useragent_cook=($useragent==1?$_COOKIE[COOK_PREF.'_useragenttext']:$useragent); if(!empty($useragent_cook)) $out.="User-Agent: $useragent_cook\r\n"; } if(!empty($http_auth)) $out.="Authorization: $http_auth\r\n"; if(empty($_COOKIE[COOK_PREF.'_remove_referer']) && !empty($referer)) $out.='Referer: '.str_replace(' ','+',$referer)."\r\n"; if($_SERVER['REQUEST_METHOD']=='POST') $out.='Content-Length: '.strlen($post_vars)."\r\nContent-Type: application/x-www-form-urlencoded\r\n"; $cook_prefdomain=preg_replace('/^www\./i',null,$urlobj->get_servername()); #* $cook_prefix=str_replace('.','_',$cook_prefdomain).COOKIE_SEPARATOR; if(count($_COOKIE)>0 && empty($_COOKIE[COOK_PREF.'_remove_cookies'])){ $addtoout=null; reset($_COOKIE); while(list($key,$val)=each($_COOKIE)){ if(ENCRYPT_COOKS){ $key=proxdec($key); $val=proxdec($val); #urldecode($val)); } if(str_replace(COOKIE_SEPARATOR,null,$key)==$key) continue; #$cook_domain=preg_replace('/^(.*'.COOKIE_SEPARATOR.').*$/','\1',$key); #** $cook_domain=substr($key,0,strpos($key,COOKIE_SEPARATOR)).COOKIE_SEPARATOR; if(substr($cook_prefix,strlen($cook_prefix)-strlen($cook_domain),strlen($cook_domain))!=$cook_domain) continue; $key=substr($key,strlen($cook_domain),strlen($key)-strlen($cook_domain)); if(!in_array($key,$proxy_variables)) $addtoout.=" $key=$val;"; } if(!empty($addtoout)){ $addtoout.="\r\n"; $out.="Cookie:{$addtoout}"; } } $out.="Accept: */*;q=0.1\r\n". (GZIP_PROXY_SERVER?"Accept-Encoding: gzip\r\n":null). //"Accept-Charset: ISO-8859-1,utf-8;q=0.1,*;q=0.1\r\n". /*/ "Keep-Alive: 300\r\n". "Connection: keep-alive\r\n". /*/ "Connection: close\r\n". //*/ ($cache_control!=null?"Cache-Control: $cache_control\r\n":null). ($if_modified!=null?"If-Modified-Since: $if_modified\r\n":null). ($if_none_match!=null?"If-None-Match: $if_none_match\r\n":null). "\r\n{$post_vars}" ; // This part ignores any "SSL: fatal protocol error" errors, and makes sure other errors are still triggered correctly function errorHandle($errno,$errmsg){ if($errno<=E_PARSE && ($errno!=E_WARNING || substr($errmsg,-25)!='SSL: fatal protocol error')){ restore_error_handler(); trigger_error($errmsg,$errno<<8); set_error_handler('errorHandle'); } } set_error_handler('errorHandle'); $fp=@fsockopen($ipaddress,$portval,$errno,$errval,5) or havok(6,$servername,$portval); stream_set_timeout($fp,5); # for persistent connections, this may be necessary /* $ub=stream_get_meta_data($fp); $ub=$ub['unread_bytes']; if($ub>0) fread($fp,$ub); */ fwrite($fp,$out); $response='100'; while($response=='100'){ $responseline=fgets($fp,8192); $response=substr($responseline,9,3); $headers=array(); while($curline!="\r\n" && $curline=fgets($fp,8192)){ $harr=explode(':',$curline,2); $headers[strtolower($harr[0])][]=trim($harr[1]); } } #if($headers['pragma'][0]==null) header('Pragma: public'); #if($headers['cache-control'][0]==null) header('Cache-Control: public'); #if($headers['last-modified'][0]==null && $headers['expires']==null) header('Expires: '.date('D, d M Y H:i:s e',time()+86400)); # read and store cookies if(empty($_COOKIE[COOK_PREF.'_remove_cookies'])){ for($i=0;$i=1){ $chunk=fread($fp,$bufsize); if($justoutputnow) echo $chunk; else $body.=$chunk; $bufsize-=strlen($chunk); } fread($fp,2); } } // Content-Length stuff - commented for even more chocolatey goodness /*elseif($headers['content-length'][0]!=null){ $conlen=$headers['content-length'][0]; $body=null; for($i=0;$i<$conlen;$i+=$read){ $read=($conlen-$i<8192?$conlen-$i:8192); $byte=fread($fp,$read); if($justoutputnow) echo $byte; else $body.=$byte; } }*/ else{ if(function_exists('stream_get_contents')){ if($justoutputnow) echo stream_get_contents($fp); else $body=stream_get_contents($fp); } else{ $body=null; while(true){ $chunk=fread($fp,8192); if(empty($chunk)) break; if($justoutputnow) echo $chunk; else $body.=$chunk; } } } fclose($fp); restore_error_handler(); if(GZIP_PROXY_SERVER && $headers['content-encoding'][0]=='gzip') $body=gzinflate(substr($body,10)); if($justoutput){ if(!$justoutputnow) echo $body; finish(); } return array($body,$url,$cook_prefix); } # }}} # }}} # PROXY EXECUTION {{{ # PROXY EXECUTION: USER COOKIES {{{ global $proxy_variables; $proxy_variables=array(COOK_PREF,COOK_PREF.'_pip',COOK_PREF.'_pport',COOK_PREF.'_useragent',COOK_PREF.'_useragenttext',COOK_PREF.'_url_form',COOK_PREF.'_remove_cookies',COOK_PREF.'_remove_referer',COOK_PREF.'_remove_scripts',COOK_PREF.'_remove_objects',COOK_PREF.'_encrypt_urls',COOK_PREF.'_encrypt_cooks'); if($postandget[COOK_PREF.'_set_values']){ $proxy_varblacklist=array(COOK_PREF); if($postandget[COOK_PREF.'_useragent']!='1'){ unset($postandget[COOK_PREF.'_useragenttext']); dosetcookie(COOK_PREF.'_useragenttext',false,0); } while(list($key,$val)=each($proxy_variables)){ if(!in_array($val,$proxy_varblacklist)){ dosetcookie($val,false,0); if(isset($postandget[$val]) && !empty($postandget[$val])) dosetcookie($val,$postandget[$val]); } } $theurl=framify_url(surrogafy_url(ORIG_URL),PAGETYPE_FRAME_TOP); #$theurl=surrogafy_url((ENCRYPT_URLS?proxdec($theurl):$theurl),null); header("Location: {$theurl}"); finish(); } # }}} # PROXY EXECUTION: PROXY GET/POST/COOKIES {{{ define('PIP',(FORCE_DEFAULT_TUNNEL?$_COOKIE[COOK_PREF.'_pip']:DEFAULT_TUNNEL_PIP)); define('PPORT',intval(FORCE_DEFAULT_TUNNEL?$_COOKIE[COOK_PREF.'_pport']:DEFAULT_TUNNEL_PPORT)); define('ENCRYPT_COOKS',gethardattr('encrypt_cooks')); global $referer; if($_SERVER['HTTP_REFERER']==null){ $refurlobj=new aurl($_SERVER['HTTP_REFERER']); $referer=proxdec(preg_replace('/^[\s\S]*'.COOK_PREF.'=([^&]*)[\s\S]*$/i','\1',$refurlobj->get_path())); #* } else $referer=null; #$getkeys=array_keys($_GET); #foreach($getkeys as $getvar){ if(!in_array($getvar,$proxy_variables)){ $curr_url.=(strpos($curr_url,'?')===false?'?':'&')."$getvar=".urlencode($_GET[$getvar]); } } global $post_vars; $post_vars=null; $postkeys=array_keys($_POST); foreach($postkeys as $postkey){ if(!in_array($postkey,$proxy_variables)){ if(!is_array($_POST[$postkey])) $post_vars.=($post_vars!=null?'&':null).httpclean($postkey).'='.httpclean($_POST[$postkey]); else{ foreach($_POST[$postkey] as $postval) $post_vars.=($post_vars!=null?'&':null).httpclean($postkey).'%5B%5D='.httpclean($postval); } } } unset($postkeys); # }}} # PROXY EXECUTION: DNS CACHE {{{ if(!isset($_SESSION['DNS_CACHE_ARRAY'])) $dns_cache_array=array(); else $dns_cache_array=$_SESSION['DNS_CACHE_ARRAY']; # purge old records from DNS cache while(list($key,$entry)=each($dns_cache_array)){ if($entry['time']0 if(($base{0}=='"' && substr($base,-1)=='"') || ($base{0}=='\'' && substr($base,-1)=='\'')) $base=substr($base,1,strlen($base)-2); #* $curr_url=$base; } unset($base); } global $curr_urlobj; $curr_urlobj=new aurl($curr_url); # PROXY EXECUTION: PAGE PARSING: PARSING FUNCTIONS {{{ function parse_html($regexp,$partoparse,$html,$addproxy,$framify){ global $curr_urlobj; $newhtml=null; while(preg_match($regexp,$html,$matcharr,PREG_OFFSET_CAPTURE)){ $nurl=surrogafy_url($matcharr[$partoparse][0],$curr_urlobj,$addproxy); if($framify) $nurl=framify_url($nurl,$framify); $begin=$matcharr[$partoparse][1]; $end=$matcharr[$partoparse][1]+strlen($matcharr[$partoparse][0]); $newhtml.=substr_replace($html,$nurl,$begin); $html=substr($html,$end,strlen($html)-$end); } $newhtml.=$html; return $newhtml; } function regular_express($regexp_array,$thevar){ #$regexp_array[2].='S'; # in benchmarks, this 'optimization' appeared to not do anything at all, or possibly even slow things down if($regexp_array[0]==1) $newvar=preg_replace($regexp_array[2],$regexp_array[3],$thevar); elseif($regexp_array[0]==2){ $addproxy=(isset($regexp_array[4])?$regexp_array[4]:true); $framify=(isset($regexp_array[5])?$regexp_array[5]:false); $newvar=parse_html($regexp_array[2],$regexp_array[3],$thevar,$addproxy,$framify); } return $newvar; } function parse_all_html($html){ global $regexp_arrays; if(CONTENT_TYPE!='text/html'){ for(reset($regexp_arrays);list($key,$arr)=each($regexp_arrays);){ if($key==CONTENT_TYPE){ foreach($arr as $regarr){ if($regarr==null) continue; $html=regular_express($regarr,$html); } } } return $html; } #if(!empty($_COOKIE[COOK_PREF.'_remove_scripts'])) $splitarr=array($html); $splitarr=preg_split('/(||)/is',$html,-1,PREG_SPLIT_DELIM_CAPTURE); unset($html); //define('REGEXP_SCRIPT_ONEVENT','( on[a-z]{3,20}=(?:"(?:[^"]+)"|\'(?:[^\']+)\'|[^"\' >][^ >]+[^"\' >]))'); $firstrun=true; $firstjsrun=true; for(reset($regexp_arrays);list($key,$arr)=each($regexp_arrays);){ if($key=='text/javascript') continue; // OPTION1: use ONLY if no Javascript REGEXPS affect HTML sections // and all HTML modifying Javascript REGEXPS are performed after HTML regexps // This gives a pretty significant speed boost // If used, make sure "OPTION2" lines are commented, and other "OPTION1" lines AREN'T if($firstjsrun && $key=='application/x-javascript'){ if(!empty($_COOKIE[COOK_PREF.'_remove_scripts'])) break; $splitarr2=array(); for($i=0;$is and noscript tags; also remove objects if($firstrun && (!empty($_COOKIE[COOK_PREF.'_remove_scripts']) || !empty($_COOKIE[COOK_PREF.'_remove_objects']))){ for($i=0;$i)/is',null,$splitarr[$i]); if(!empty($_COOKIE[COOK_PREF.'_remove_objects'])) $splitarr[$i]=preg_replace('/<(embed|object).*?<\/\1>/is',null,$splitarr[$i]); } } foreach($arr as $regexp_array){ if($regexp_array==null) continue; for($i=0;$is if($i%2==0 && isset($splitarr2) && $regexp_array[1]==2){ // OPTION1 // OPTION2 //if($regexp_array[1]==2 && $i%2==0){ // OPTION2 //$splitarr2[$i]=preg_split('/( on[a-z]{3,20}=(?:"(?:[^"]+)"|\'(?:[^\']+)\'|[^"\' >][^ >]+[^"\' >]))/is',$splitarr[$i],-1,PREG_SPLIT_DELIM_CAPTURE); // END OPTION2 //if(count($splitarr2[$i])<2) $splitarr[$i]=regular_express($regexp_array,$splitarr[$i]); // UNRELATED TO OPTIONS if(count($splitarr2[$i])>1){ for($j=1;$j' && !preg_match('/^[^>]*src/i',$splitarr[$i])){ $splitarr[$i]=preg_replace('/'.END_OF_SCRIPT_TAG.'$/i',';'.COOK_PREF.'.purge();//-->',$splitarr[$i]); } } $firstrun=false; if($firstjsrun && $key=='application/x-javascript') $firstjsrun=false; } } // OPTION1 if(empty($_COOKIE[COOK_PREF.'_remove_scripts'])){ for($i=0;$i':null). ''. (empty($_COOKIE[COOK_PREF.'_remove_scripts'])? ''. ''. '' :null) ; $body=preg_replace('/(?:(<(?:head|body)[^>]*>)|(<(?:\/head|meta|link|script)))/i',"\\1$big_headers\\2",$body,1); unset($big_headers); } elseif(CONTENT_TYPE=='application/x-javascript' || CONTENT_TYPE=='text/javascript') $body.=';'.COOK_PREF.'.purge();'; # }}} # }}} ## Retrieved, Parsed, All Ready to Output ## echo $body; //echo 'total time: '.(microtime(true)-$totstarttime)."
parse time: {$parsetime} seconds".(isset($oparsetime)?"
other time 1: {$oparsetime} seconds":null).(isset($oparsetime2)?"
other time 2: {$oparsetime2} seconds":null); # BENCHMARK # }}} finish(); ############ ## THE END ## ############## # # VIM is the ideal way to edit this file. Automatic folding occurs making the # blocks of code easier to read and navigate # vim:foldmethod=marker # ################## ?>