Download Latest Version phpwebsockets-1.4.1.tar.gz (84.3 kB)
Email in envelope

Get an email when there's a new version of PHP Websockets

Home
Name Modified Size InfoDownloads / Week
CHANGELOG 2013-03-26 5.4 kB
README 2013-03-26 3.5 kB
phpwebsockets-1.4.1.tar.gz 2013-03-26 84.3 kB
phpwebsockets-1.3.1.tar.gz 2013-01-25 23.6 kB
phpwebsockets-1.3.tar.gz 2013-01-16 20.6 kB
phpwebsockets-1.2.tar.gz 2013-01-14 64.3 kB
phpwebsockets-1.0.tar.gz 2012-12-27 12.2 kB
Totals: 7 Items   213.9 kB 0
Welcome to the PHP Websockets open source project.

Author: Snap Web Systems: http://www.snapws.com
Version: 1.4
Release Date: 3-25-2013

If you use this extension, we ask that you donate $5
to support development of this project and keep it free.
We have costs like any other business, but we don't run
ads or apply for government grants. Our goal is to supply
the best possible software for people such as yourself.
If everyone reading this gave a mere $5, we could easily
earn enough money to develop and release the next version
of this software. We made an initial investment of
labor and development in order to release this software
and we really hope that was a good investment on our part.
We hope you enjoy this software and that you find it useful.

TO DONATE: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN9T2M6MU7CUS

INSTALLATION:
Follow the installation instructions for your OS below.
(Coming soon - Prebuilt binary (RPM) packages for Fedora, Redhat, and CentOS)

LINUX INSTALLATION - Tested and works on the following systems:
- Fedora Core 17 PHP-5.4.9 x86_64
- Fedora Core 18 PHP-5.4.10 x86_64
- Fedora Core 18 PHP-5.4.12 x86_64

Build it from source - Simply unpack the files and at a shell prompt type these commands.

# phpize
# ./configure --enable-websockets
# make
# make install
# cp websockets.ini /etc/php.d/

If all went smoothly, websockets should be installed and working.
If you have any issues, please post them in the sourceforge ticket system
https://sourceforge.net/p/phpwebsockets/tickets/

NOTE: You will have to re-build if you update PHP

WINDOWS INSTALLATION - No instructions yet as we have not tested this module on windows.
But, we plan to if we get enough donations for this project.

TESTING:
To test your installation, you will need the following:
1. Shell access to your server
2. A websockets RFC6455 compliant web browser (We used Google Chrome 23.0)

Step 1. Make sure that port 10000 is open on your server.
(You can change the port in the websockets_server.php file)
If you don't know how to do this, simply type the following
at a command prompt to disable the firewall completely.
(This only works for Redhat, CentOS, Fedora distros.
Your distro may use a different command to disable the firewall)

On CentOS, Redhat, and Fedora <= 17
# service iptables stop

On Fedora 18
# service firewalld stop

(WARNING: The above commands will disable your firewall completely. Do not do this on a production system.
Instead, you should really learn how to properly configure your firewall - which is beyond the scope of this document)

Step 2. At your server shell (command prompt) type the following command
to start the websockets server and start listening for incoming connections

# php websockets_server.php

Step 3. Open up your web browser and point it to your host at
port 10000 (or whatever you set the port to in websockets_server.php)

http://server_ip:10000

Step 4.
Create your own websockets application.
There is some sample code in the websockets_client.php file and the websockets_server.php file
to help get you started. There also is a lot of comments in these files to help you understand
the way this extension works. The main thing is now you can use PHP to directly communicate
with your websockets enabled browser. Happy coding!

If you use an IDE like Netbeans or PhpStorm you can include the ws_stubs.php file in your project
to get code hinting, generate PHP Documentation, etc.
Source: README, updated 2013-03-26