PHP Classes

Exchange chat messages using Ratchet Websockets: Exchange chat messages using Ratchet Websockets

Recommend this page to a friend!
  Info   View files Example   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-03-29 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 18 All time: 11,236 This week: 84Up
Version License PHP version Categories
socket-card 1.0MIT/X Consortium ...7Web services, Chat, PHP 7
Description 

Author

This package can exchange chat messages using Ratchet Websockets.

It provides a class that implements the Ratchet MessageInterface to implement functions that handle WebSockets events like the opening of a connection or the arrival of a new message.

The package also provides a Web page that users can use to send messages via Web forms using JavaScript code that communicates with a WebSocket server.

Picture of Rodrigo Faustino
  Performance   Level  
Name: Rodrigo Faustino <contact>
Classes: 19 packages by
Country: Brazil Brazil
Age: 40
All time rank: 2694187 in Brazil Brazil
Week rank: 7 Up2 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 14x

Winner: 1x

Example

<?php

use Ratchet\Server\IoServer;
use
Ratchet\Http\HttpServer;
use
Ratchet\WebSocket\WsServer;
use
MyApp\Socket;

require
dirname( __FILE__ ) . '/vendor/autoload.php';

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

$server->run();


Details

Sample PHP WebSocket Server Built with Ratchet

This scaffold will allow you to create a WebSocket server in your PHP environment. View the tutorial "How to Create a WebSocket Server in PHP to Build a Real-Time Application" for additional information and context.


  Files folder image Files  
File Role Description
Files folder imageapp (1 file)
Files folder imageimg (8 files)
Accessible without login Plain text file app.js Data Auxiliary data
Accessible without login Plain text file app.php Example Example script
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.html Data Chat page
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  app  
File Role Description
  Plain text file socket.php Class Class source

  Files folder image Files  /  img  
File Role Description
  Accessible without login Image file god1.png Data Auxiliary data
  Accessible without login Image file god2.png Data Auxiliary data
  Accessible without login Image file god3.png Data Auxiliary data
  Accessible without login Image file god4.png Data Auxiliary data
  Accessible without login Image file god5.png Data Auxiliary data
  Accessible without login Image file god6.png Data Auxiliary data
  Accessible without login Image file god7.png Data Auxiliary data
  Accessible without login Image file god8.png Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:18
This week:0
All time:11,236
This week:84Up