2017 © Pedro Peláez
 

library thruway

Thruway WAMP router core

image

voryx/thruway

Thruway WAMP router core

  • Monday, April 9, 2018
  • by mbonneau
  • Repository
  • 49 Watchers
  • 506 Stars
  • 178,027 Installations
  • PHP
  • 19 Dependents
  • 2 Suggesters
  • 86 Forks
  • 36 Open issues
  • 38 Versions
  • 10 % Grown

The README.md

Build Status, (*1)

Thruway

Thruway is an open source client and router implementation of WAMP (Web Application Messaging Protocol), for PHP. Thruway uses an event-driven, non-blocking I/O model (reactphp), perfect for modern real-time applications., (*2)

Supported WAMP Features

Basic Spec read more * Publish and Subscribe * Remote Procedure Calls * Websocket Transport * Internal Transport* * JSON serialization, (*3)

Advanced Spec read more * RawSocket Transport * Authentication * WAMP Challenge-Response Authentication * Custom Authentication Methods * Authorization * Publish & Subscribe * Subscriber Black and Whitelisting * Publisher Exclusion * Publisher Identification * Subscriber Meta Events * Event History* * Subscription Matching * Prefix matching * Remote Procedure Calls * Caller Identification * Progressive Call Results * Distributed Registrations & Calls* * Caller Exclusion * Canceling Calls, (*4)

* Thruway specific features, (*5)

Requirements

Thruway is only supported on PHP 5.6 and up., (*6)

Quick Start with Composer

Create a directory for the test project, (*7)

  $ mkdir thruway

Switch to the new directory, (*8)

  $ cd thruway

Download Composer more info, (*9)

  $ curl -sS https://getcomposer.org/installer | php

Download Thruway and dependencies, (*10)

  $ php composer.phar require voryx/thruway

If you're going to also use the Thruway Client install a client transport. You'll need this to run the examples, (*11)

  $ php composer.phar require thruway/pawl-transport

Start the WAMP router, (*12)

  $ php vendor/voryx/thruway/Examples/SimpleWsRouter.php

Thruway is now running on 127.0.0.1 port 9090, (*13)

PHP Client Example

<?php

require __DIR__ . '/vendor/autoload.php';

use Thruway\ClientSession;
use Thruway\Peer\Client;
use Thruway\Transport\PawlTransportProvider;

$client = new Client("realm1");
$client->addTransportProvider(new PawlTransportProvider("ws://127.0.0.1:9090/"));

$client->on('open', function (ClientSession $session) {

    // 1) subscribe to a topic
    $onevent = function ($args) {
        echo "Event {$args[0]}\n";
    };
    $session->subscribe('com.myapp.hello', $onevent);

    // 2) publish an event
    $session->publish('com.myapp.hello', ['Hello, world from PHP!!!'], [], ["acknowledge" => true])->then(
        function () {
            echo "Publish Acknowledged!\n";
        },
        function ($error) {
            // publish failed
            echo "Publish Error {$error}\n";
        }
    );

    // 3) register a procedure for remoting
    $add2 = function ($args) {
        return $args[0] + $args[1];
    };
    $session->register('com.myapp.add2', $add2);

    // 4) call a remote procedure
    $session->call('com.myapp.add2', [2, 3])->then(
        function ($res) {
            echo "Result: {$res}\n";
        },
        function ($error) {
            echo "Call Error: {$error}\n";
        }
    );
});


$client->start();

Javascript Clients

You can also use AutobahnJS or any other WAMPv2 compatible client., (*14)

Here are some [examples] (https://github.com/tavendo/AutobahnJS#show-me-some-code), (*15)

Here's a plunker that will allow you to run some tests against a local router, (*16)

For AngularJS on the frontend, use the Angular WAMP wrapper., (*17)

The Versions

09/03 2018

dev-issue287

dev-issue287

Thruway WAMP router core

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

23/10 2017
23/10 2017

0.5.x-dev

0.5.9999999.9999999-dev

Thruway WAMP router core

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

15/07 2017

dev-ratchet-0.4

dev-ratchet-0.4

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

15/07 2017

0.4.x-dev

0.4.9999999.9999999-dev

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

28/01 2016

0.4.2

0.4.2.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

26/01 2016

0.4.1

0.4.1.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

19/01 2016

0.4.0

0.4.0.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

02/11 2015

0.3.x-dev

0.3.9999999.9999999-dev

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

02/11 2015

0.3.10

0.3.10.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

07/10 2015

dev-internal_client_schedule

dev-internal_client_schedule

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

24/08 2015

0.0.4

0.0.4.0

WebSockets (WAMP2) integration for Symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

symfony sockets wamp websockets wamp2 autobahn

24/08 2015

0.3.9

0.3.9.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

26/05 2015

0.0.3

0.0.3.0

WebSockets (WAMP2) integration for Symfony2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Matt Bonneau
by David Dan

symfony sockets wamp websockets wamp2 autobahn

25/05 2015

0.3.8

0.3.8.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

21/05 2015

0.3.7

0.3.7.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

22/04 2015

0.3.6

0.3.6.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

22/04 2015

0.3.5

0.3.5.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

22/04 2015

0.3.4

0.3.4.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

06/03 2015

0.3.3

0.3.3.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

06/03 2015

0.0.2

0.0.2.0

WebSockets (WAMP2) integration for Symfony2

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

symfony sockets wamp websockets wamp2 autobahn

03/03 2015

0.3.2

0.3.2.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

20/02 2015

0.0.1

0.0.1.0

WebSockets (WAMP2) integration for Symfony2

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

symfony sockets wamp websockets wamp2 autobahn

07/02 2015

0.3.1

0.3.1.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

06/01 2015

0.3.0

0.3.0.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

17/11 2014

0.2.x-dev

0.2.9999999.9999999-dev

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

17/11 2014

0.2.3

0.2.3.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

10/11 2014

0.2.2

0.2.2.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

07/11 2014

0.2.1

0.2.1.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

01/10 2014

0.2.0

0.2.0.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

08/09 2014

0.1.3

0.1.3.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

19/07 2014

0.1.2

0.1.2.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

07/07 2014

0.1.1

0.1.1.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn

05/07 2014

0.1.0

0.1.0.0

PHP WAMP2 library

  Sources   Download

MIT

The Requires

 

by Matt Bonneau
by David Dan

server client sockets wamp websockets wamp2 autobahn