Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

Ratchet

> 编程语言
Open source

Asynchronous WebSocket server

6.4K stars0 likes2 views
WebsiteGitHub

About

Asynchronous WebSocket server

Ratchet

A PHP library for asynchronously serving WebSockets. Build up your application through simple interfaces and re-use your application without changing any of its code just by combining different components.

Reviving Ratchet!

We're currently aiming to revive Ratchet to get it up to date with the latest versions and use this as a starting point for bigger updates to come. We need your help to achieve this goal, see ticket #1054 for ways to help out. ❤️

Requirements

Shell access is required and root access is recommended. To avoid proxy/firewall blockage it's recommended WebSockets are requested on port 80 or 443 (SSL), which requires root access. In order to do this, along with your sync web stack, you can either use a reverse proxy or two separate machines. You can find more details in the server conf docs.

Documentation

User and API documentation is available on Ratchet's website: http://socketo.me

See https://github.com/cboden/Ratchet-examples for some out-of-the-box working demos using Ratchet.

Need help? Have a question? Want to provide feedback? Write a message on the Google Groups Mailing List.


A quick example

…
$ php chat.php
javascript
    // Then some JavaScript in the browser:
    var conn = new WebSocket('ws://localhost:8080/echo');
    conn.onmessage = function(e) { console.log(e.data); };
    conn.onopen = function(e) { conn.send('Hello Me!'); };

Install

The recommended way to install this library is through Composer. New to Composer?

This will install the latest supported version:

bash
composer require cboden/ratchet:^0.4.4

See also the CHANGELOG for details about version upgrades.

This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.4 through current PHP 8+. It's highly recommended to use the latest supported PHP version for this project.

See above note about Reviving Ratchet for newer PHP support.

License

MIT, see LICENSE file.

Issues· 9 open

View all issuesOpen on GitHub
  • #1054

    Reviving Ratchet: Let's give Ratchet the love it deserves! [11 sponsors reached ]

    enhancementquestionUpdated Jul 13, 2026
  • #999

    Omit `X-Powered-By` HTTP response header to avoid exposing Ratchet version to potential attackers

    enhancementsecurityHTTPUpdated Jul 9, 2026
  • #939

    Ratchet on 100% CPU load

    bugawaiting feedbackUpdated Jul 31, 2025
  • #382

    Handling permessage-deflate requests

    enhancementWebSocketUpdated Jul 3, 2025
  • #251

    Wamp session IDs are insecure

    WAMPawaiting feedbackUpdated Jun 26, 2025
  • #850

    Roadmap

    enhancementarchitecturefeaturedocsUpdated Jun 26, 2025
  • #749

    Congestion control

    questionfeatureUpdated Jun 25, 2025
  • #1037

    Limiting message size

    enhancementUpdated Jun 2, 2025

> Tags

PHPasyncphpratchetwebsocket

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 24, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言