Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.61 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.61 KB

A Guzzle Cloudflare bypass middleware.

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require cornford/guzzle-cloudflare-middleware.

"require": {
    "cornford/guzzle-cloudflare-middleware": "1.*"
}

Finally, update Composer from the Terminal:

composer update

Usage

It's really as simple as using the middleware class with Guzzle:

use GuzzleHttp\Client;
use Cornford\GuzzleCloudflareMiddleware\CloudflareMiddleware;
use GuzzleHttp\Cookie\FileCookieJar;

$client = new Client(['cookies' => new FileCookieJar('cookies.txt')]);

$client->getConfig('handler')->push(CloudflareMiddleware::create());

$res = $client->request('GET', 'http://www.exemple.com/');
echo $res->getBody();

License

guzzle-cloudflare-middleware is open-sourced software licensed under the MIT license