jie-anthony / laravel-octane-workerman
This package is abandoned and no longer maintained.
No replacement package was suggested.
Start the laravel project through gatewayworker to make the development of laravel in the Internet of Things more convenient. Fetch and communicate with different gateways via API.
v3.0.5
2022-09-01 05:17 UTC
Requires
- php: ^8.0
- ext-json: *
- ext-pcntl: *
- ext-posix: *
- laravel/octane: ^1.0
- workerman/gateway-worker: ^3.0
- workerman/gatewayclient: ^3.0
- workerman/psr7: ^1.0
- workerman/workerman: ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
README
Discussions
访问地址 https://laravel-workerman.iwnweb.com/
Todos
- Support Workerman v5
- add make Events command
- add make Socket Command
- add make CustomProcess command
- add global setRegisterAddress of API method
Screenshot
Start the laravel project through gatewayworker
to make the development of laravel in the Internet of Things more convenient. Fetch and communicate with different gateways via API.
Installing
$ composer config repositories.laravel-octane-workerman vcs https://github.com/mouyong/laravel-octane-workerman # support workerman:gateway and workerman:http command install from https://github.com/mouyong/laravel-octane-workerman $ composer require jie-anthony/laravel-octane-workerman:dev-master -vvv # just support octane:workerman command, install from https://github.com/JieAnthony/laravel-octane-workerman $ composer require jie-anthony/laravel-octane-workerman -vvv
Configuration
php artisan vendor:publish --provider="Laravel\Octane\OctaneServiceProvider" php artisan vendor:publish --provider="JieAnthony\LaravelOctaneWorkerman\WorkermanGatewayWorkerServiceProvider"
configuration edit in config/workerman.php
Command parameter
option | default |
---|---|
host | 0.0.0.0 |
port | 8000 |
max-requests | 10000 |
mode | start |
watch |
mode options : ( start / daemon / stop )
Useage
php artisan worker start php artisan worker daemon php artisan worker reload php artisan worker stop php artisan worker status -d php artisan make:sockets Sockets php artisan make:events Events php artisan make:process CustomProcess
webman plugin useage
Documentation
websockets
The tcp ddos-proxy-http
address
ws://127.0.0.1:7000/ws
location /ws {
# the websocket address with http protocol
proxy_pass http://127.0.0.1:7200;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'Upgrade';
}
test connection to websocket
var ws = new WebSocket('ws://127.0.0.1:7000/ws')
ws.onmessage = function (data) {
console.log("server response ws data: " + data)
}
ws.send('send message test from client')
Thanks
Contact
Join QQ Group 650057913
License
MIT