ytake/socketio-cli

This package is abandoned and no longer maintained. No replacement package was suggested.

Send events and receive socket.io PHP client

v2.0.3 2013-11-15 12:44 UTC

This package is auto-updated.

Last update: 2022-02-01 12:35:16 UTC


README

MIT Licenced

install

    "require": {
        "ytake/socketio-cli": "dev-master"
    },

Send messages and Receive

// namespace support
$client->client("http://localhost:3000")->query(['query' => 1])
    // namespace
    ->of('/active')->connection(function() use($client){
            // event receive
            $client->on('connection', function($data) use($client){
                    // value from socket.io server
                    var_dump($data);
                });
            // event emit
            $client->emit('sender', ['hello']);
            // event receive
            $client->on('message', function($data) use($client){
                    // value from socket.io server
                    var_dump($data);
                    $client->disconnect();
                });
        })->keepAlive();

Licence

This software is distributed under MIT License. See license.txt file for more info.

Special Thanks

Special thanks goes to Wisembly team authors of Elephant.io