jaymoulin/guzzlehttp-cloudflare

This package is abandoned and no longer maintained. No replacement package was suggested.

Bypass Cloudflare protection using GuzzleHTTP

1.1.1 2020-03-22 15:53 UTC

This package is auto-updated.

Last update: 2020-08-27 20:42:19 UTC


README

logo

Guzzle Cloudflare Bypass

latest release

PayPal donation Buy me a coffee Become a Patron

(This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)

IMPORTANT NOTE: as KyranRana's dependency is actually not maintained anymore (https://github.com/KyranRana/cloudflare-bypass/commit/00d34f0050b817b858bbf5fd349b9911932f353f), this package won't be as-well. Thank you for your understanding. Please have a look at my other works (https://github.com/jaymoulin | https://twitch.tv/cursedware | https://patreon.com/jaymoulin | https://discord.gg/ujjrPCu | https://jaymoulin.me)

Bypass Cloudflare DDoS protection - Please use it carefully

This package is based on KyranRana's cloudflare-bypass.

Installation

Using composer

composer require jaymoulin/guzzlehttp-cloudflare

Usage

$sUrl = 'https://thebot.net/';
$oClient = new \GuzzleHttp\Client([
    'cookies' => new \GuzzleHttp\Cookie\FileCookieJar(tempnam('/tmp', __CLASS__)),
    'headers' => ['Referer' => $sUrl],
]); // 1. Create Guzzle instance
$aOptions = [
    'cache' => new \CloudflareBypass\Storage($sPathToYourCacheFolder),
]; // Example for cache, this is completely optional, with $sPathToYourCacheFolder a string to your cache folder
/** @var \GuzzleHttp\HandlerStack $oHandler */
$oHandler = $oClient->getConfig('handler');
$oHandler->push(\GuzzleCloudflare\Middleware::create($aOptions)); //2. ???

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