PHPackages                             cheatcodes/guzzle-hsts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. cheatcodes/guzzle-hsts

ActiveLibrary[HTTP &amp; Networking](/categories/http)

cheatcodes/guzzle-hsts
======================

v0.1.0(9y ago)235MITPHP

Since Oct 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/CheatCodes/guzzle-hsts)[ Packagist](https://packagist.org/packages/cheatcodes/guzzle-hsts)[ RSS](/packages/cheatcodes-guzzle-hsts/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

guzzle-hsts
===========

[](#guzzle-hsts)

[![Build Status](https://camo.githubusercontent.com/590ae5b8fb2e4f2920631e78a9de42771084e98949f374ab546e95b72a56e18b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4368656174436f6465732f67757a7a6c652d687374732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/CheatCodes/guzzle-hsts)[![Coverage Status](https://camo.githubusercontent.com/3266e5818d9ea0b2fab1c268b842a2bf9ae1cffb4a83118964f18922361d3236/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f4368656174436f6465732f67757a7a6c652d687374732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/CheatCodes/guzzle-hsts/code-structure)[![Quality Score](https://camo.githubusercontent.com/1911e4a125d667e3420d8d544f2f1e1aa6d55b14fd63da985ec7bcad8f2397da/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6368656174636f6465732f67757a7a6c652d687374732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/CheatCodes/guzzle-hsts/)[![Software License](https://camo.githubusercontent.com/5d219089566d647481cf96f7d612addd8efbd5454fdb829989916899a6626792/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6368656174636f6465732f67757a7a6c652d687374732e7376673f7374796c653d666c61742d737175617265266d61784167653d3836343030)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/b313ef26b5488a3f499e455a764b9e32af65c8a17d81c164bf01fd5db1a8e182/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368656174636f6465732f67757a7a6c652d687374732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cheatcodes/guzzle-hsts)

This is a [Guzzle](https://github.com/guzzle/guzzle) middleware to handle [HTTP Strict Transport Security](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security).

Installation
------------

[](#installation)

Make sure you have [Composer](https://getcomposer.org/) installed and add guzzle-hsts as a dependency.

```
$ composer require cheatcodes/guzzle-hsts
```

Usage
-----

[](#usage)

Make sure Guzzle uses the `CheatCodes\GuzzleHsts\HstsMiddleware::handler()` as a middleware by pushing it onto the handler stack. After that, all http requests to known HSTS hosts will be automatically rewritten to https.

An example:

```
use CheatCodes\GuzzleHsts\HstsMiddleware;
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;

$stack = HandlerStack::create();

// Add HSTS middleware to the handler
$stack->push(HstsMiddleware::handler());

// Initialize the Guzzle client with the handler
$client = new Client(['handler' => $stack]);

// Make a request to a https host with HSTS enabled
$client->request('GET', 'https://hsts.badssl.com/');

// Later requests to the same hosts will automatically be rewritten to https
$client->request('GET', 'http://hsts.badssl.com/');
```

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3488d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9d13c66fc3b41d0de6c53925efed6a9814d05acd5bf1b3e2382ee5902377c43?d=identicon)[CheatCodes](/maintainers/CheatCodes)

---

Top Contributors

[![CheatCodes](https://avatars.githubusercontent.com/u/4729881?v=4)](https://github.com/CheatCodes "CheatCodes (11 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/cheatcodes-guzzle-hsts/health.svg)

```
[![Health](https://phpackages.com/badges/cheatcodes-guzzle-hsts/health.svg)](https://phpackages.com/packages/cheatcodes-guzzle-hsts)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
