2017 © Pedro Peláez
 

library websocket-client

A simple PHP WebSocket Client

image

gabrielbull/websocket-client

A simple PHP WebSocket Client

  • Monday, May 4, 2015
  • by gabrielbull
  • Repository
  • 5 Watchers
  • 57 Stars
  • 58,218 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 26 Forks
  • 1 Open issues
  • 11 Versions
  • 9 % Grown

The README.md

WebSocket client

Build Status Latest Stable Version Total Downloads License, (*1)

A simple WebSocket WAMP client implemented in PHP., (*2)

This is an implementation of WAMP version 1. I have not had the time to implement WAMP 2, but if you do, that would be awesome., (*3)

Requirements

This library uses PHP 5.4+., (*4)

Install

It is recommended that you install the WebSocket client library through composer., (*5)

{
    "require": {
        "gabrielbull/websocket-client": "dev-master"
    }
}

Usage

Here is an example of a simple WebSocket client:, (*6)

use WebSocketClient\WebSocketClient;
use WebSocketClient\WebSocketClientInterface;

class Client implements WebSocketClientInterface
{
    private $client;

    public function onWelcome(array $data)
    {
    }

    public function onEvent($topic, $message)
    {
    }

    public function subscribe($topic)
    {
        $this->client->subscribe($topic);
    }

    public function unsubscribe($topic)
    {
        $this->client->unsubscribe($topic);
    }

    public function call($proc, $args, Closure $callback = null)
    {
        $this->client->call($proc, $args, $callback);
    }

    public function publish($topic, $message)
    {
        $this->client->publish($topic, $message);
    }

    public function setClient(WebSocketClient $client)
    {
        $this->client = $client;
    }
}

$loop = React\EventLoop\Factory::create();

$client = new WebSocketClient(new Client, $loop);

$loop->run();

The Versions

04/05 2015

dev-master

9999999-dev https://github.com/gabrielbull/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

05/09 2014

dev-develop

dev-develop https://github.com/gabrielbull/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

05/09 2014

0.3.1

0.3.1.0 https://github.com/gabrielbull/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

05/09 2014

0.3.0

0.3.0.0 https://github.com/gabrielbull/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

27/03 2014

0.2.1

0.2.1.0 https://github.com/gabrielbull/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

27/03 2014

0.2.0

0.2.0.0 https://github.com/gabrielbull/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

11/11 2013

0.1.4

0.1.4.0 https://github.com/gavroche/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

10/11 2013

0.1.3

0.1.3.0 https://github.com/gavroche/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

08/11 2013

0.1.2

0.1.2.0 https://github.com/gavroche/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

08/11 2013

0.1.1

0.1.1.0 https://github.com/gavroche/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket

03/11 2013

0.1.0

0.1.0.0 https://github.com/gavroche/php-websocket-client

A simple PHP WebSocket Client

  Sources   Download

MIT

The Requires

 

The Development Requires

client websocket