定制 lamoimage/larasocket 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lamoimage/larasocket

Composer 安装命令:

composer require lamoimage/larasocket

包简介

a web socket server build with laravel and swoole

README 文档

README

##Screenshot enter image description here

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

run below command to install swool extension and add "extension=swoole.so" to php.ini.

pecl install swoole

Now pull in Larasocket package through Composer.

Run composer require lamoimage/larasocket

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

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

Usage

Start the socket service with php artisan socket:start command

php artisan socket:start

Then access the route /larasocket in browser:

If you are using homestead, the url looks like

http://homestead.app/larasocket

You may also do socket:stop/socket:restart to shutdown or restart the socket service.

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

If you need to modify the socket server partials, you can run:

php artisan vendor:publish

The SWOOLE config file will now be located in the config/larasocket.php.

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,

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

统计信息

  • 总下载量: 86
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固