PHPackages                             calcinai/bolt - 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. calcinai/bolt

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

calcinai/bolt
=============

Asynchronous WebSocket client

v1.1.3(7y ago)72624[1 issues](https://github.com/calcinai/bolt/issues)MITPHP

Since Oct 16Pushed 7y ago3 watchersCompare

[ Source](https://github.com/calcinai/bolt)[ Packagist](https://packagist.org/packages/calcinai/bolt)[ RSS](/packages/calcinai-bolt/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (12)Used By (0)

bolt
====

[](#bolt)

Asynchronous WebSocket client client library for PHP. Supports HyBi, as well as Hixie #76 (no point).

This was built purely to be a client, as the majority of the WS clients available also contain servers and are very bloated.

Installation
============

[](#installation)

Using composer:

```
composer require calcinai/bolt

```

Usage
=====

[](#usage)

Since this really lends itself to being an asynchronous app, it is built to use the React event loops and resolver since there's a good chance they'll be in your project already and this lets you attach to the same loop.

```
$loop = \React\EventLoop\Factory::create();
$dns_factory = new React\Dns\Resolver\Factory();
$resolver = $dns_factory->createCached('8.8.8.8', $loop);

$client = new \Calcinai\Bolt\Client('ws://127.0.0.1:1337/chat', $loop, $resolver);

//Most WS servers will complain/forbid if there is no origin header
$client->setOrigin('127.0.0.1');

$client->connect();

$client->on('stateChange', function($newState){
    echo "State changed to: $newState\n";
});

$client->on('message', function($message) use ($client){
    echo "New message: \n";
    echo $message;

    $client->send('This is a response message');
});

$loop->run();
```

Other available events are `connecting`, `connect`, `disconnecting`, `disconnect`

HTTP basic auth is also supported via the URI inf the form `user:pass@host`

Any feedback is most welcome

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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

Every ~132 days

Recently: every ~92 days

Total

11

Last Release

2591d ago

Major Versions

v0.1.4 → v1.0.02018-05-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2415868?v=4)[Michael Calcinai](/maintainers/calcinai)[@calcinai](https://github.com/calcinai)

---

Top Contributors

[![calcinai](https://avatars.githubusercontent.com/u/2415868?v=4)](https://github.com/calcinai "calcinai (22 commits)")[![mattrenner](https://avatars.githubusercontent.com/u/1264226?v=4)](https://github.com/mattrenner "mattrenner (3 commits)")

---

Tags

boltphp-websocketratchetreactwebsockets

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/calcinai-bolt/health.svg)

```
[![Health](https://phpackages.com/badges/calcinai-bolt/health.svg)](https://phpackages.com/packages/calcinai-bolt)
```

###  Alternatives

[cboden/ratchet

PHP WebSocket library

6.4k22.3M254](/packages/cboden-ratchet)[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.6k15.1M84](/packages/laravel-reverb)[ratchet/pawl

Asynchronous WebSocket client

62010.0M242](/packages/ratchet-pawl)[jaggedsoft/php-binance-api

PHP Binance API is an asynchronous PHP library for the Binance API designed to be easy to use.

650186.1k4](/packages/jaggedsoft-php-binance-api)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[clue/http-proxy-react

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP

492.3M35](/packages/clue-http-proxy-react)

PHPackages © 2026

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