2017 © Pedro Peláez
 

library larasocket

a web socket server build with laravel and swoole

image

lamoimage/larasocket

a web socket server build with laravel and swoole

  • Saturday, June 17, 2017
  • by lamoimage
  • Repository
  • 1 Watchers
  • 3 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Larasocket - a web socket server build with laravel and swoole

Screenshot

enter image description here, (*1)

Installation

Make sure you have the SWOOLE PHP package installed. You can find installation instructions at http://pecl.php.net/package/swoole and http://www.swoole.com, (*2)

run below command to install swool extension and add "extension=swoole.so" to php.ini., (*3)

pecl install swoole

Now pull in Larasocket package through Composer., (*4)

Run composer require lamoimage/larasocket, (*5)

And then, if using Laravel 5, include the service provider within config/app.php., (*6)

'providers' => [
    Lamoimage\Larasocket\LarasocketServiceProvider::class,
];

Usage

Start the socket service with php artisan socket:start command, (*7)

php artisan socket:start

Then access the route /larasocket in browser:, (*8)

If you are using homestead, the url looks like, (*9)

http://homestead.app/larasocket, (*10)

You may also do socket:stop/socket:restart to shutdown or restart the socket service., (*11)

  • php artisan socket:stop
  • php artisan socket:restart

If you need to modify the socket server partials, you can run:, (*12)

php artisan vendor:publish

The SWOOLE config file will now be located in the config/larasocket.php., (*13)

If you want to handle your own socket service logic, just implement the socket interface located at vendor/lamoimage/larasocket/Socket.php, then register in app/Providers/AppServiceProvider.php,, (*14)

public function register()
{
    $this->app->bind('Lamoimage\Larasocket\Socket', 'App\Services\MySocket');
}

The Versions

17/06 2017

dev-master

9999999-dev

a web socket server build with laravel and swoole

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Lamoimage Z

laravel websocket swoole socket

27/09 2016

0.1

0.1.0.0

a web socket server build with laravel and swoole

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Lamoimage Z