PHP Classes

File: bin/chat-server.php

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Simple PHP Chat with Websocket   bin/chat-server.php   Download  
File: bin/chat-server.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple PHP Chat with Websocket
Implements a chat system using Websockets
Author: By
Last change:
Date: 1 month ago
Size: 355 bytes
 

Contents

Class file image Download
<?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();