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

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

lowerpower/bolt
===============

Asynchronous WebSocket client built on ReactPHP

0.2.0(8y ago)018MITPHP

Since Oct 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lowerpower/bolt)[ Packagist](https://packagist.org/packages/lowerpower/bolt)[ RSS](/packages/lowerpower-bolt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (7)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.

This is not the original version, this has been updated to use latest reactphp and the API has been modified to be more consistant with modern reactphp.

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

[](#installation)

Using composer:

```
"require": {
    "lowerpower/bolt": "^0.2"
}

```

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();

// other options like tls, socket, etc are possible see "React\Socket\Connector"
$options=$options=array(
    'timeout'=>5.0                      /* 'timeout'=> false for disable */
);

// Now workes exaction like "React\Socket\Connector"
$client = new \Calcinai\Bolt\Client($loop, $options);

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

// new, URL is here, ws:// and wss:// supported
$client->connect('ws://127.0.0.1:1337/chat');

$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`, `closing`, `close`

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

Any feedback is most welcome

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.3% 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 ~147 days

Recently: every ~183 days

Total

6

Last Release

3124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1daf2a916de370283c6eb29e4cbec7df077753eb7c84bfdf756d68f669c39db2?d=identicon)[lowerpower](/maintainers/lowerpower)

---

Top Contributors

[![lowerpower](https://avatars.githubusercontent.com/u/7493281?v=4)](https://github.com/lowerpower "lowerpower (18 commits)")[![calcinai](https://avatars.githubusercontent.com/u/2415868?v=4)](https://github.com/calcinai "calcinai (14 commits)")

### Embed Badge

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

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

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

41.5k328.9k1](/packages/ccxt-ccxt)[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

113154.9k1](/packages/clue-docker-react)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)

PHPackages © 2026

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