Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ratchetphp/Ratchet
Browse files Browse the repository at this point in the history
  • Loading branch information
samizdam committed Mar 2, 2018
2 parents 101f54d + 0d31f3a commit 82f2505
Show file tree
Hide file tree
Showing 64 changed files with 694 additions and 3,518 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
@@ -1,13 +1,20 @@
language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- 7.0
- 7.1
- hhvm

dist: trusty

matrix:
allow_failures:
- php: hhvm

before_script:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "session.serialize_handler = php" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- php -m
- composer install --dev --prefer-source
169 changes: 83 additions & 86 deletions CHANGELOG.md
@@ -1,138 +1,135 @@
CHANGELOG
=========

###Legend
### Legend

* "BC": Backwards compatibility break (from public component APIs)
* "BF": Bug fix

---

* 0.4.1 (2017-12-11)
* Only enableKeepAlive in App if no WsServer passed allowing user to set their own timeout duration
* Support Symfony 4
* BF: Plug NOOP controller in connection from router in case of misbehaving client
* BF: Raise error from invalid WAMP payload

* 0.4 (2017-09-14)
* BC: $conn->WebSocket->request replaced with $conn->httpRequest which is a PSR-7 object
* Binary messages now supported via Ratchet\WebSocket\MessageComponentInterface
* Added heartbeat support via ping/pong in WsServer
* BC: No longer support old (and insecure) Hixie76 and Hybi protocols
* BC: No longer support disabling UTF-8 checks
* BC: The Session component implements HttpServerInterface instead of WsServerInterface
* BC: PHP 5.3 no longer supported
* BC: Update to newer version of react/socket dependency
* BC: WAMP topics reduced to 0 subscriptions are deleted, new subs to same name will result in new Topic instance
* Significant performance enhancements

* 0.3.6 (2017-01-06)
* BF: Keep host and scheme in HTTP request object attatched to connection
* BF: Return correct HTTP response (405) when non-GET request made
* BF: Keep host and scheme in HTTP request object attatched to connection
* BF: Return correct HTTP response (405) when non-GET request made

* 0.3.5 (2016-05-25)

* BF: Unmask responding close frame
* Added write handler for PHP session serializer
* BF: Unmask responding close frame
* Added write handler for PHP session serializer

* 0.3.4 (2015-12-23)

* BF: Edge case where version check wasn't run on message coalesce
* BF: Session didn't start when using pdo_sqlite
* BF: WAMP currie prefix check when using '#'
* Compatibility with Symfony 3
* BF: Edge case where version check wasn't run on message coalesce
* BF: Session didn't start when using pdo_sqlite
* BF: WAMP currie prefix check when using '#'
* Compatibility with Symfony 3

* 0.3.3 (2015-05-26)

* BF: Framing bug on large messages upon TCP fragmentation
* BF: Symfony Router query parameter defaults applied to Request
* BF: WAMP CURIE on all URIs
* OriginCheck rules applied to FlashPolicy
* Switched from PSR-0 to PSR-4
* BF: Framing bug on large messages upon TCP fragmentation
* BF: Symfony Router query parameter defaults applied to Request
* BF: WAMP CURIE on all URIs
* OriginCheck rules applied to FlashPolicy
* Switched from PSR-0 to PSR-4

* 0.3.2 (2014-06-08)

* BF: No messages after closing handshake (fixed rare race condition causing 100% CPU)
* BF: Fixed accidental BC break from v0.3.1
* Added autoDelete parameter to Topic to destroy when empty of connections
* Exposed React Socket on IoServer (allowing FlashPolicy shutdown in App)
* Normalized Exceptions in WAMP
* BF: No messages after closing handshake (fixed rare race condition causing 100% CPU)
* BF: Fixed accidental BC break from v0.3.1
* Added autoDelete parameter to Topic to destroy when empty of connections
* Exposed React Socket on IoServer (allowing FlashPolicy shutdown in App)
* Normalized Exceptions in WAMP

* 0.3.1 (2014-05-26)

* Added query parameter support to Router, set in HTTP request (ws://server?hello=world)
* HHVM compatibility
* BF: React/0.4 support; CPU starvation bug fixes
* BF: Allow App::route to ignore Host header
* Added expected filters to WAMP Topic broadcast method
* Resource cleanup in WAMP TopicManager
* Added query parameter support to Router, set in HTTP request (ws://server?hello=world)
* HHVM compatibility
* BF: React/0.4 support; CPU starvation bug fixes
* BF: Allow App::route to ignore Host header
* Added expected filters to WAMP Topic broadcast method
* Resource cleanup in WAMP TopicManager

* 0.3.0 (2013-10-14)

* Added the `App` class to help making Ratchet so easy to use it's silly
* BC: Require hostname to do HTTP Host header match and do Origin HTTP header check, verify same name by default, helping prevent CSRF attacks
* Added Symfony/2.2 based HTTP Router component to allowing for a single Ratchet server to handle multiple apps -> Ratchet\Http\Router
* BC: Decoupled HTTP from WebSocket component -> Ratchet\Http\HttpServer
* BF: Single sub-protocol selection to conform with RFC6455
* BF: Sanity checks on WAMP protocol to prevent errors
* Added the `App` class to help making Ratchet so easy to use it's silly
* BC: Require hostname to do HTTP Host header match and do Origin HTTP header check, verify same name by default, helping prevent CSRF attacks
* Added Symfony/2.2 based HTTP Router component to allowing for a single Ratchet server to handle multiple apps -> Ratchet\Http\Router
* BC: Decoupled HTTP from WebSocket component -> Ratchet\Http\HttpServer
* BF: Single sub-protocol selection to conform with RFC6455
* BF: Sanity checks on WAMP protocol to prevent errors

* 0.2.8 (2013-09-19)

* React 0.3 support
* React 0.3 support

* 0.2.7 (2013-06-09)

* BF: Sub-protocol negotation with Guzzle 3.6
* BF: Sub-protocol negotation with Guzzle 3.6

* 0.2.6 (2013-06-01)

* Guzzle 3.6 support
* Guzzle 3.6 support

* 0.2.5 (2013-04-01)

* Fixed Hixie-76 handshake bug
* Fixed Hixie-76 handshake bug

* 0.2.4 (2013-03-09)

* Support for Symfony 2.2 and Guzzle 2.3
* Minor bug fixes when handling errors
* Support for Symfony 2.2 and Guzzle 2.3
* Minor bug fixes when handling errors

* 0.2.3 (2012-11-21)

* Bumped dep: Guzzle to v3, React to v0.2.4
* More tests
* Bumped dep: Guzzle to v3, React to v0.2.4
* More tests

* 0.2.2 (2012-10-20)

* Bumped deps to use React v0.2
* Bumped deps to use React v0.2

* 0.2.1 (2012-10-13)

* BF: No more UTF-8 warnings in browsers (no longer sending empty sub-protocol string)
* Documentation corrections
* Using new composer structure
* BF: No more UTF-8 warnings in browsers (no longer sending empty sub-protocol string)
* Documentation corrections
* Using new composer structure

* 0.2 (2012-09-07)

* Ratchet passes every non-binary-frame test from the Autobahn Testsuite
* Major performance improvements
* BC: Renamed "WampServer" to "ServerProtocol"
* BC: New "WampServer" component passes Topic container objects of subscribed Connections
* Option to turn off UTF-8 checks in order to increase performance
* Switched dependency guzzle/guzzle to guzzle/http (no API changes)
* mbstring no longer required
* Ratchet passes every non-binary-frame test from the Autobahn Testsuite
* Major performance improvements
* BC: Renamed "WampServer" to "ServerProtocol"
* BC: New "WampServer" component passes Topic container objects of subscribed Connections
* Option to turn off UTF-8 checks in order to increase performance
* Switched dependency guzzle/guzzle to guzzle/http (no API changes)
* mbstring no longer required

* 0.1.5 (2012-07-12)

* BF: Error where service wouldn't run on PHP <= 5.3.8
* Dependency library updates
* BF: Error where service wouldn't run on PHP <= 5.3.8
* Dependency library updates

* 0.1.4 (2012-06-17)

* Fixed dozens of failing AB tests
* BF: Proper socket buffer handling
* Fixed dozens of failing AB tests
* BF: Proper socket buffer handling

* 0.1.3 (2012-06-15)

* Major refactor inside WebSocket protocol handling, more loosley coupled
* BF: Proper error handling on failed WebSocket connections
* BF: Handle TCP message concatenation
* Inclusion of the AutobahnTestSuite checking WebSocket protocol compliance
* mb_string now a requirement
* Major refactor inside WebSocket protocol handling, more loosley coupled
* BF: Proper error handling on failed WebSocket connections
* BF: Handle TCP message concatenation
* Inclusion of the AutobahnTestSuite checking WebSocket protocol compliance
* mb_string now a requirement

* 0.1.2 (2012-05-19)

* BC/BF: Updated WAMP API to coincide with the official spec
* Tweaks to improve running as a long lived process
* BC/BF: Updated WAMP API to coincide with the official spec
* Tweaks to improve running as a long lived process

* 0.1.1 (2012-05-14)

* Separated interfaces allowing WebSockets to support multiple sub protocols
* BF: remoteAddress variable on connections returns proper value
* Separated interfaces allowing WebSockets to support multiple sub protocols
* BF: remoteAddress variable on connections returns proper value

* 0.1 (2012-05-11)

* First release with components: IoServer, WsServer, SessionProvider, WampServer, FlashPolicy, IpBlackList
* I/O now handled by React, making Ratchet fully asynchronous
* First release with components: IoServer, WsServer, SessionProvider, WampServer, FlashPolicy, IpBlackList
* I/O now handled by React, making Ratchet fully asynchronous
21 changes: 14 additions & 7 deletions Makefile
Expand Up @@ -10,26 +10,33 @@ cover:
abtests:
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8001 LibEvent &
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8002 StreamSelect &
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-noutf8.php 8003 StreamSelect &
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8004 LibEv &
wstest -m testeeserver -w ws://localhost:8000 &
sleep 1
wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-all.json
killall php wstest

abtest:
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8000 StreamSelect &
sleep 1
wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-quick.json
killall php

profile:
php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver.php 8000 LibEvent &
sleep 1
wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-profile.json
killall php

apidocs:
apigen --title Ratchet -d reports/api -s src/ \
-s vendor/react \
-s vendor/guzzle \
-s vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Session \
-s vendor/symfony/routing/Symfony/Component/Routing \
-s vendor/evenement/evenement/src/Evenement
apigen --title Ratchet -d reports/api \
-s src/ \
-s vendor/ratchet/rfc6455/src \
-s vendor/react/event-loop/src \
-s vendor/react/socket/src \
-s vendor/react/stream/src \
-s vendor/psr/http-message/src \
-s vendor/symfony/http-foundation/Session \
-s vendor/symfony/routing \
-s vendor/evenement/evenement/src/Evenement \
--exclude=vendor/symfony/routing/Tests \
21 changes: 7 additions & 14 deletions README.md
@@ -1,26 +1,19 @@
#Ratchet
# Ratchet

[![Build Status](https://secure.travis-ci.org/ratchetphp/Ratchet.png?branch=master)](http://travis-ci.org/ratchetphp/Ratchet)
[![Autobahn Testsuite](https://img.shields.io/badge/Autobahn-passing-brightgreen.svg)](http://socketo.me/reports/ab/index.html)
[![Latest Stable Version](https://poser.pugx.org/cboden/ratchet/v/stable.png)](https://packagist.org/packages/cboden/ratchet)

A PHP 5.3 library for asynchronously serving WebSockets.
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.

##WebSocket Compliance

* Supports the RFC6455, HyBi-10+, and Hixie76 protocol versions (at the same time)
* Tested on Chrome 13+, Firefox 6+, Safari 5+, iOS 4.2+, IE 8+
* Ratchet [passes](http://socketo.me/reports/ab/) the [Autobahn Testsuite](http://autobahn.ws/testsuite) (non-binary messages)

##Requirements
## 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](http://socketo.me/docs/deploy#serverconfiguration).

PHP 5.3.9 (or higher) is required. If you have access, PHP 5.4 (or higher) is *highly* recommended for its performance improvements.

### Documentation

User and API documentation is available on Ratchet's website: http://socketo.me
Expand All @@ -31,7 +24,7 @@ Need help? Have a question? Want to provide feedback? Write a message on the

---

###A quick example
### A quick example

```php
<?php
Expand Down Expand Up @@ -86,5 +79,5 @@ class MyChat implements MessageComponentInterface {
// Then some JavaScript in the browser:
var conn = new WebSocket('ws://localhost:8080/echo');
conn.onmessage = function(e) { console.log(e.data); };
conn.send('Hello Me!');
```
conn.onopen = function(e) { conn.send('Hello Me!'); };
```
16 changes: 10 additions & 6 deletions composer.json
Expand Up @@ -2,7 +2,7 @@
"name": "cboden/ratchet"
, "type": "library"
, "description": "PHP WebSocket library"
, "keywords": ["WebSockets", "Server", "Ratchet", "Sockets"]
, "keywords": ["WebSockets", "Server", "Ratchet", "Sockets", "WebSocket"]
, "homepage": "http://socketo.me"
, "license": "MIT"
, "authors": [
Expand All @@ -23,10 +23,14 @@
}
}
, "require": {
"php": ">=5.3.9"
, "react/socket": "^0.3 || ^0.4"
, "guzzle/http": "^3.6"
, "symfony/http-foundation": "^2.2|^3.0"
, "symfony/routing": "^2.2|^3.0"
"php": ">=5.4.2"
, "ratchet/rfc6455": "^0.2"
, "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5"
, "guzzlehttp/psr7": "^1.0"
, "symfony/http-foundation": "^2.6|^3.0|^4.0"
, "symfony/routing": "^2.6|^3.0|^4.0"
}
, "require-dev": {
"phpunit/phpunit": "~4.8"
}
}

0 comments on commit 82f2505

Please sign in to comment.