Skip to content

Commit 7a052dd

Browse files
committed
Updated README and added CHANGELOG
1 parent 01ef499 commit 7a052dd

File tree

2 files changed

+62
-24
lines changed

2 files changed

+62
-24
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- vim: set tw=79 sw=4 ts=4 et ft=markdown : -->
2+
# Changelog
3+
## 1.0.0
4+
5+
* Refactored methods to open up more of the protected API.
6+
* @lemmingzshadow switched the server to use streams instead of sockets, and
7+
implemented SSL support.
8+
* @mazhack added support for the new WebSocket object in Firefox 11.
9+
* Plenty of bugfixes

README.md

+53-24
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,68 @@
1-
PHP WebSocket
2-
=============
3-
A websocket server implemented in php.
1+
<!-- vim: set tw=79 sw=4 ts=4 et ft=markdown : -->
2+
# PHP WebSocket
3+
## Simple WebSocket server for PHP
44

5-
- Supports websocket draft hybi-10,13 (Currently tested with Chrome 18 and Firefox 11).
5+
Version: **1.0.0**
6+
7+
A simple websocket server for PHP 5.3, using streams.
8+
9+
### Features
10+
11+
- Supports websocket draft hybi-10,13 (Currently tested with Chrome 18 and
12+
Firefox 11).
613
- Supports origin-check.
714
- Supports various security/performance settings.
815
- Supports binary frames. (Currently receive only)
916
- Supports wss. (Needs valid certificate in Firefox.)
10-
- Application module, the server can be extended by custom behaviors.
1117

12-
## Bugs/Todos/Hints
13-
- Add support for fragmented frames.
1418

15-
## Server example
19+
### Backward compatibility
20+
21+
The public API of the server should remain compatible with early versions of
22+
php-websocket. The WebSocket namespace begins in the `/server/lib` directory.
23+
The client-side libraries are deprecated and may be removed in future: the
24+
exist as an example. You're free to use whatever client-side libraries you'd
25+
like with the server.
26+
27+
## Installation
1628

17-
This creates a server on localhost:8000 with one Application that listens on `ws://localhost:8000/demo`:
29+
The library is PSR-0 compatible, with a vendor name of WebSocket (note the
30+
capital S). An SplClassLoader is bundled for convenience.
1831

19-
$server = new \WebSocket\Server('127.0.0.1', 8000, false); // host,port,ssl
32+
## Usage
2033

21-
// server settings:
22-
$server->setCheckOrigin(true);
23-
$server->setAllowedOrigin('foo.lh');
24-
$server->setMaxClients(100);
25-
$server->setMaxConnectionsPerIp(20);
26-
$server->setMaxRequestsPerMinute(1000);
34+
This creates a server on 127.0.0.1:8000 with one Application that listens on
35+
`ws://localhost:8000/demo`:
2736

28-
$server->registerApplication('demo', \WebSocket\Application\DemoApplication::getInstance());
29-
$server->run();
37+
```php
38+
// $interface, $port, $ssl
39+
$server = new \WebSocket\Server(127.0.0.1', 8000, false);
3040

31-
## Libraries used
41+
// Origin checking is supported
42+
$server->setCheckOrigin(true);
43+
$server->setAllowedOrigin('example.org')
3244

33-
- [SplClassLoader](http://gist.github.com/221634) by the PHP Standards Working Group
34-
- [jQuery](http://jquery.com/)
35-
- [CoffeeScript PHP] (https://github.com/alxlit/coffeescript-php)
45+
// As is basic rate limiting
46+
$server->setMaxClients(100);
47+
$server->setMaxConnectionsPerIp(20);
48+
$server->setMaxRequestsPerMinute(1000);
49+
50+
$server->registerApplication('demo', \WebSocket\Application\DemoApplication::getInstance());
51+
$server->run();
52+
```
53+
## Authors
54+
55+
The original maintainer and author was
56+
[@nicokaiser](https://github.com/nicokaiser). Plentiful improvements were
57+
contributed by [@lemmingzshadow](https://github.com/lemmingzshadow) and
58+
[@mazhack](https://github.com/mazhack). The server is licensed under the WTFPL,
59+
a free software compatible license.
60+
61+
## Bugs/Todos/Hints
62+
63+
- Add support for fragmented frames.
64+
- To report issues, see the [issue tracker](https://github.com/varspool/php-websocket/issues).
3665

37-
## Demo
66+
## Examples
3867

39-
- Check out http://jitt.li for a sample-project using this websocket server.
68+
- [Jitt.li](http://jitt.li), a Twitter API sample project.

0 commit comments

Comments
 (0)