enniel/wampeer

Provide thruway library to laravel

dev-master 2016-08-16 05:41 UTC

This package is auto-updated.

Last update: 2024-12-06 04:21:21 UTC


README

Build Status StyleCI License

Wampeer

Composer

To install as a Composer package to be used with Laravel 5, simply run:

composer require "enniel/wampeer"

Once it's installed, you can register the service provider in config/app.php in the providers array:

'providers' => [
  \Enniel\Wampeer\Providers\WampeerServiceProvider::class,
]

You can use the facade for shorter code. Add this to your aliases:

'aliases' => [
  'WampRouter' => \Enniel\Wampeer\Facades\Router::class,
]

Then publish assets with php artisan vendor:publish. This will add the file config/wampeer.php.

Usage

Set up code in the boot method at your provider

WampRouter::registerModules([
    // Websocket listener
    new RatchetTransportProvider(),
    // Rawsocket listener
    new RawSocketTransportProvider(),
]);
WampRouter::addInternalClient(new SimpleAuthProviderClient(["testSimpleAuthRealm", "authful_realm"]));