PHP Classes

Exchange chat messages using Ratchet Websockets: Exchange chat messages using Ratchet 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-03-29 (6 months ago) RSS 2.0 feedNot enough user ratingsTotal: 19 All time: 11,311 This week: 73Up
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: 27 packages by
Country: Brazil Brazil
Age: 41
All time rank: 2509173 in Brazil Brazil
Week rank: 4 Up1 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 17x

Winner: 2x

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 (14)  
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 (14)  /  app  
File Role Description
  Plain text file socket.php Class Class source

  Files folder image Files (14)  /  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

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:19
This week:0
All time:11,311
This week:73Up