sergey-s-moiseev/cloudflare-middleware

Cloudflare Middleware For Guzzle

v1.2 2018-02-07 09:18 UTC

This package is auto-updated.

Last update: 2024-10-16 20:16:04 UTC


README

Bypass Cloudflare Middleware For Guzzle

Installation

Using composer:

composer require tunaabutbul/cloudflare-middleware

Usage

use GuzzleHttp\Client;
use Tuna\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();

Thanks

License

This middleware is licensed under the MIT License - see the LICENSE file for details