addcnos / laravel-gateway-worker
Gateway-worker for Laravel
1.0.0
2021-07-01 05:20 UTC
Requires
- php: >=7.1.0
- illuminate/console: ^5.7|^6.0|^7.0|^8.0
- illuminate/support: ^5.7|^6.0|^7.0|^8.0
- workerman/gateway-worker: ^3.0
- workerman/gatewayclient: ^3.0
- workerman/workerman: ^3.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- orchestra/testbench: ^4.0
- phpstan/phpstan: ^0.12
README
Installation
Laravel
composer require addcnos/laravel-gateway-worker
publish
php artisan vendor:publish --provider="Addcnos\GatewayWorker\GatewayWorkerServiceProvider"
Lumen
copy config
cp vendor/addcnos/laravel-gateway-worker/config/gatewayworker.php config
edit bootstrap/app.php
, add
$app->register(Addcnos\GatewayWorker\GatewayWorkerServiceProvider::class); // ... $app->configure('gatewayworker');
Usage
php artisan gateway-worker:serve [start|stop|restart|status|connections|help]
for help
php artisan gateway-worker:serve --help
Cluster
Cluster
Role | IP | Command |
---|---|---|
Register | 192.168.1.101 | php artisan gateway-worker:serve --register --register-bind=0.0.0.0:1215 |
Gateway | 192.168.2.102-105 | php artisan gateway-worker:serve --gateway --gateway-bind=0.0.0.0:1216 --register-address=192.168.1.101:1215 --lan-ip=192.168.1.xxx |
Businessworker | 192.168.1.106-110 | php artisan gateway-worker:serve --businessworker --register-address=192.168.1.101:1215 |
In One
php artisan --register --gateway --businessworker