High performance HTTP server based on Swoole. Speeds up your Laravel and Lumen applications.
bulaohe/swoole is a Laravel package for high performance http server based on swoole. speeds up your laravel and lumen applications..
It currently has 1 GitHub stars and 104 downloads on Packagist (latest version 6.0.2).
Install it with composer require bulaohe/swoole.
Discover more Laravel packages by bulaohe
or browse all Laravel packages to compare alternatives.
Last updated
Integrate Swoole into Laravel and Lumen 5.5,5.7,5.8,6.x
You should reset the instances of Singleton mode Facades Classes in the method register of your self-defined ServiceProvider like below:
add clear code in the register function Facade::clearResolvedInstance('your-service-alias-name');
add config/http.providers your service provider App\Providers{YourProvider}::class,
php artisan swoole:http --host=0.0.0.0 --port=9807 --pid_file=/tmp/swoole1.pid start/stop/reload/restart
php artisan swoole:http --host=0.0.0.0 --port=9808 --pid_file=/tmp/swoole2.pid start/stop/reload/restart
server { listen 80; server_name your_server_name; root /var/www/logistics/public; index index.php;
location = /index.php {
# Ensure that there is no such file named "not_exists" in your "public" directory.
try_files /not_exists @swoole;
}
location / {
try_files $uri $uri/ @swoole;
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix "/";
}
proxy_set_header Host $host;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# IF https
# proxy_set_header HTTPS "on";
proxy_pass http://127.0.0.1:9807$suffix;
}
}