PHPackages                             werkraum/websocket-provider - 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. werkraum/websocket-provider

ActiveTypo3-cms-extension[HTTP &amp; Networking](/categories/http)

werkraum/websocket-provider
===========================

Run a websocket server within the TYPO3 context with extensible server logic.

0.3.1(3y ago)015GPL-2.0-or-laterPHP

Since Jan 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jonakieling/typo3-websocket-provider)[ Packagist](https://packagist.org/packages/werkraum/websocket-provider)[ RSS](/packages/werkraum-websocket-provider/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

websocket\_provider
===================

[](#websocket_provider)

Provides basic setup to run [Ratchet](https://github.com/ratchetphp/Ratchet) WebSocket servers within TYPO3.

Currently only for \*nix Systems

`composer req werkraum/websocket-provider`

`typo3cms websocket:start`

Routes and Components
---------------------

[](#routes-and-components)

### Components

[](#components)

Implement the Ratchet interface `Ratchet\MessageComponentInterface` in your extension. This is going to be the entry point for your logic.

```
class YourMessageComponent implements Ratchet\MessageComponentInterface
{
    // interface methods with your logic go here
}
```

Mark your component as public to make use of the Symfony dependency injection within it. Tag your component with `websocket.component` to register it with the WebSocket provider.

*Configuration/Services.yaml*

```
# default service setup goes here

services:
  Vendor\Extension\WebSocket\YourMessageComponent:
    public: true
    tags: ['websocket.component']
```

### Routes

[](#routes)

Symfony Routes are used to provide multi-tenancy.

You may let your component implement the interface [CustomRouteInterface](Classes%2FInterfaces%2FCustomRouteInterface.php). Return your custom route path with a leading slash (e.g. `/socket.io/my_component`).

> The default route for `Vendor\Extension\MyComponent` is `/Vendor_Extension_MyComponent`

> Be aware that the route of your WebSockets may be prefixed by whatever you have set for your webserver config. In my case this is often /socket.io. You can set this server-wide prefix in the settings. The prefix is then prepended to every component route, even third-party ones using this extension.

### The Loop

[](#the-loop)

In case you need periodic timer or want to handle signals you can implement the interface [ConfigureLoopInterface](Classes%2FInterfaces%2FConfigureLoopInterface.php). You'll get the loop as parameter. The signals SIGTERM and SIGINT are already registered to shut down the server.

Configuration
-------------

[](#configuration)

See [ext\_conf\_template.txt](ext_conf_template.txt) for all configuration options.

Commands
--------

[](#commands)

CommandDescription`websocket:list`Lists running websocket servers`websocket:routes`Lists all configured routes`websocket:start`Starts the websocket server`websocket:stop`Stops the websocket serverDemo
----

[](#demo)

Ratchet ships a simple echo component. You can register it via Symfony DI.

any *Configuration/Services.yaml*

```
Ratchet\Server\EchoServer:
  public: true
  tags: ['websocket.component']
```

Security
--------

[](#security)

### Authentication

[](#authentication)

The current frontend and backend user sessions are added to the connection as UserAspects. The ID of the connection is added as well.

```
$conn->feUser
$conn->beUser
```

Connections are not rejected when not authenticated. Additionally the authentication is only checked on opening a connection.

### Rate limiting

[](#rate-limiting)

A basic limiter is shipped and can be configured in the settings. More sophisticated rate limiting should probably be done by your webserver.

Server config
-------------

[](#server-config)

`ext-json`, `ext-pcntl` and `ext-posix` are required for the cli commands to check on the status of the server.

### NGINX

[](#nginx)

Laravel has some good documentation on how to setup NGINX for WebSockets.

### DDEV

[](#ddev)

Open the port. Either via DDEV config [`web_extra_exposed_ports`](https://ddev.readthedocs.io/en/stable/users/configuration/config/#web_extra_exposed_ports) or a custom docker-compose file.

*docker-compose.websockets.yaml*

```
version: '3.6'
services:
  web:
    ports:
      - "18080"
```

Port and the URL part `/socket.io` can be adjusted to your needs. I recommend setting the extension setting `route_prefix` to whatever you set as the URL part in your websocket config.

Below is the proxy pass config that needs to be added to the webserver config. This uses a custom URL part to distinguish between WebSocket and regular HTTP requests. This integrates well with existing webserver configuration for TYPO3. The Laravel documentation has a Nginx setup without the URL part.

> Remember to remove the `#ddev-generated` line in the webserver config otherwise your changes will be overridden after restarting DDEV.

#### Apache

[](#apache)

```

    LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
    ProxyPass "ws://localhost:18080/socket.io"
    ProxyPassReverse "ws://localhost:18080/socket.io"
    ProxyPreserveHost On
    RequestHeader set Upgrade "websocket"
    RequestHeader set Connection "Upgrade"

```

#### NGINX

[](#nginx-1)

```
location /socket.io {
    proxy_pass http://localhost:18080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
}

```

Thanks
------

[](#thanks)

Lots of ideas and inspiration taken from

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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

Every ~10 days

Total

5

Last Release

1174d ago

### Community

Maintainers

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

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

---

Top Contributors

[![jonakieling](https://avatars.githubusercontent.com/u/876839?v=4)](https://github.com/jonakieling "jonakieling (32 commits)")

---

Tags

cliwebsocketextensioncommandtypo3

### Embed Badge

![Health badge](/badges/werkraum-websocket-provider/health.svg)

```
[![Health](https://phpackages.com/badges/werkraum-websocket-provider/health.svg)](https://phpackages.com/packages/werkraum-websocket-provider)
```

###  Alternatives

[helhum/typo3-console

A reliable and powerful command line interface for TYPO3 CMS

2939.0M192](/packages/helhum-typo3-console)[joni-jones/yii2-wschat

Online chat based on web sockets and ratchet php

981.3k](/packages/joni-jones-yii2-wschat)[aoe/restler

A TYPO3-Extension, that integrates the popular PHP REST-framework Restler in TYPO3.

3177.5k1](/packages/aoe-restler)[immusen/yii2-swoole-websocket

Websocket server for Yii2 base on swoole 4, Support JSONRPC, Resolve 'method' as a route reflect into controller/action, And support http or redis pub/sub to trigger async task from your web application.

338.8k](/packages/immusen-yii2-swoole-websocket)[kyrne/websocket

Integrated Pusher replacement.

121.6k1](/packages/kyrne-websocket)[yiiplus/yii2-websocket

使用yii2封装 websocket 扩展

212.6k](/packages/yiiplus-yii2-websocket)

PHPackages © 2026

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