cookie('id', 'blank'); $key=$request->cookie('key', 'blank'); $tor=$request->cookie('tor', 'false'); if($key=='blank' || $id=='blank'){ return redirect('/login'); } $path=$request->uri(); if($path==''||$path=='/'){ $path='/?signAll=1&ts=1657'; } $rpath=$kf.urlencode("$path"); if($redis->get($rpath)){ $response->withHeaders(json_decode($redis->hget($rpath,'CT'))); $response->withBody($redis->hget($rpath,'body')); return $response; } $host=getenv('public_url'); $httpquery=Http::timeout(60); $onion=''; $torstatus='Off'; if($tor=='true'){ $host=getenv('Zlibrary'); $httpquery=$httpquery->withProxy('socks5h://'.getenv('proxy')); $onion=''; $torstatus='On'; } $url='http://'.$host.$path; $auth=array('remix_userid'=>"$id",'remix_userkey'=>"$key",'siteLanguageV2'=>'zh','siteLanguage'=>'zh','selectedSiteMode'=>'books'); $return = $httpquery->withCookies($auth,$host)->get($url); $back=$return->body(); if($return->header('Content-Type')=='text/html; charset=UTF-8'){ $ver=getenv('version'); $copyright=getenv('copyright'); $copyright_url=getenv('copyright_url'); $front= << Zlibrary Proxy(v$ver) UserID:$id [$onion Tor $torstatus] [退出账号] [$copyright]