PHP Classes

How to Implement a PHP Chat Application using Websocket with the Package Simple PHP Chat with Websocket: Implements a chat system using Websockets

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-06-28 (9 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 9 All time: 11,504 This week: 40Up
Version License PHP version Categories
simple-php-chat-with 1.0.0The PHP License7Web services, Chat, PHP 7
Description 

Author

This package implements a chat system using Websockets.

It uses WebSockets to listen to chat connections.

The example system can reply to messages from other users connected to the chat system.

Picture of Adeleye Ayodeji
  Performance   Level  
Innovation award
Innovation award
Nominee: 18x

 

Example

<?php
require __DIR__ . '/../vendor/autoload.php';
require
__DIR__ . '/../src/Chat.php';
use
Ratchet\Server\IoServer;
use
Ratchet\Http\HttpServer;
use
Ratchet\WebSocket\WsServer;

   
$server = IoServer::factory(
        new
HttpServer(
            new
WsServer(
                new
Chat()
            )
        ),
       
8080
   
);

   
$server->run();


Details

simple-php-chat-with-websocket


  Files folder image Files (518)  
File Role Description
Files folder imagebin (1 file)
Files folder imagesrc (1 file)
Files folder imagevendor (1 file, 9 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file index.php Aux. Configuration script
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file socket.php Aux. Configuration script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:9
This week:0
All time:11,504
This week:40Up