PHPackages                             ekstazi/websocket-server-adapter - 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. ekstazi/websocket-server-adapter

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

ekstazi/websocket-server-adapter
================================

Async WebSocket server adapter for Amp based on different implementations.

1.0(6y ago)181MITPHPPHP &gt;=7.2

Since Apr 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Ekstazi/websocket-server-adapter)[ Packagist](https://packagist.org/packages/ekstazi/websocket-server-adapter)[ RSS](/packages/ekstazi-websocket-server-adapter/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

websocket-server-adapter
========================

[](#websocket-server-adapter)

Websocket server is set of interfaces that provide webaocket server for amphp

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

[](#installation)

This package can be installed as a Composer dependency.

`composer require ekstazi/websocket-server-adapter`

Requirements
============

[](#requirements)

PHP 7.2+

Interfaces
==========

[](#interfaces)

Interfaces provided

`interface ServerFactory`
-------------------------

[](#interface-serverfactory)

### Methods

[](#methods)

#### `create(Amp\Socket\Server $socket, LoggerInterface $logger = null): Server`

[](#createampsocketserver-socket-loggerinterface-logger--null-server)

Return server class instance

`interface Server`
------------------

[](#interface-server)

### Methods

[](#methods-1)

#### `public function addRoute(string $path, Handler $handler): void;`

[](#public-function-addroutestring-path-handler-handler-void)

Add handler to specified route.

#### `public function run(): void;`

[](#public-function-run-void)

Run main event loop and subscribes to SIGINT/SIGTERM signal.

#### `public function stop(): Promise`

[](#public-function-stop-promise)

Stop the server and finish event loop

`interface Handler`
-------------------

[](#interface-handler)

### Methods

[](#methods-2)

#### `public function onHandshake(ConnectionInfo $connectionInfo): Promise;`

[](#public-function-onhandshakeconnectioninfo-connectioninfo-promise)

Called after handshake negotiated but before websocket upgrade. You can validate your connections here

#### `public function handle(Connection $connection): Promise;`

[](#public-function-handleconnection-connection-promise)

This method called after upgrade is finished.

#### `public function getSubProtocols(): array;`

[](#public-function-getsubprotocols-array)

List of subprotocols supported. If client doesn't support one of it then connection not started

`interface ConnectionInfo`
--------------------------

[](#interface-connectioninfo)

### Methods

[](#methods-3)

#### `public function getId(): string;`

[](#public-function-getid-string)

Get id of connection

#### `public function getArgs(): array;`

[](#public-function-getargs-array)

Get args passed to connection

#### `public function getRemoteAddress(): string;`

[](#public-function-getremoteaddress-string)

Get remote address of client

`interface Connection extends ConnectionInterface, ConnectionInfo`
------------------------------------------------------------------

[](#interface-connection-extends-connectioninterface-connectioninfo)

For more details see [`ekstazi/websocket-common`](https://github.com/ekstazi/websocket-common)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

2220d ago

### Community

Maintainers

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

---

Top Contributors

[![Ekstazi](https://avatars.githubusercontent.com/u/992738?v=4)](https://github.com/Ekstazi "Ekstazi (2 commits)")

---

Tags

httpasyncnon-blockingserverwebsocketampamphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ekstazi-websocket-server-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/ekstazi-websocket-server-adapter/health.svg)](https://phpackages.com/packages/ekstazi-websocket-server-adapter)
```

###  Alternatives

[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)[amphp/websocket-client

Async WebSocket client for PHP based on Amp.

1613.0M39](/packages/amphp-websocket-client)[amphp/websocket

Shared code for websocket servers and clients.

453.1M9](/packages/amphp-websocket)[hhxsv5/laravel-s

🚀 LaravelS is an out-of-the-box adapter between Laravel/Lumen and Swoole.

3.9k676.0k10](/packages/hhxsv5-laravel-s)[swow/swow

Coroutine-based multi-platform support engine with a focus on concurrent I/O

1.3k2.1M84](/packages/swow-swow)[amphp/http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

7286.8M137](/packages/amphp-http-client)

PHPackages © 2026

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