Skip to content

wsphp/php-websocket-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP and WebSockets chat

This is simple HTML chat with the following features:

1) Unlimited number of connections (users).
2) Every user may select his/her nickname and color.
3) There are notifications wher someone has joined or left the chat.
4) Minumum use of PHP.

How to setup it

1) You will need a wsphp server installed.
2) Setup app_path config option to point to app.php
3) Disable cron_path config option as we do not use it.

Information

Network communications are done using Websockets. WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. That is why we can read (via ws.onmessage callback) and send messages (via ws.send) using only one websocket connection. WSPHP server takes care about websocket protocol actions: handshake, encoding/decoding frames, etc. PHP role is small - it just re-sends received message to all connected users. Messages are wrapped to JSON format for convenience.

About

Simple and fast chat written with PHP using Websockets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published