sa / guzzlehttp-cloudflare

使用 GuzzleHTTP 绕过 Cloudflare 保护

0.1.4 2019-02-07 09:01 UTC

This package is auto-updated.

Last update: 2024-09-07 22:33:55 UTC


README

logo

Guzzle Cloudflare 绕过

latest release Bitcoin donation Litecoin donation PayPal donation

绕过 Cloudflare DDoS 保护 - 请谨慎使用

此软件包基于 KyranRana 的 cloudflare-bypass

安装

使用 composer

composer require jaymoulin/guzzlehttp-cloudflare

用法

$sUrl = 'https://thebot.net/';
$oClient = new \GuzzleHttp\Client([
    'cookies' => new \GuzzleHttp\Cookie\FileCookieJar(tempnam('/tmp', __CLASS__)),
    'headers' => ['Referer' => $sUrl],
]); // 1. Create Guzzle instance
/** @var \GuzzleHttp\HandlerStack $oHandler */
$oHandler = $oClient->getConfig('handler');
$oHandler->push(\GuzzleCloudflare\Middleware::create()); //2. ???

echo (string)$oClient->request('GET', $sUrl)->getBody(); //3. Profit!!