GithubHelp home page GithubHelp logo

lumoon's Introduction

#Lumoon

Lumen on Swoole

Depends On

  • php >= 5.5.9
  • laravel/lumen > 5.1.*
  • ext-swoole >= 1.7.19

##Install

 composer require silentred/lumoon

Because Lumen does not use Http Kernel, you have to create a subclass of \Laravel\Lumen\Application under app directory. In bootstrap directory, change Application in app.php to the new one as App\Application

##Usage

 vendor/bin/lumoon start | stop | reload | restart | quit

##Config

In .env , use LUMOON_* to config swoole server. For example

LUMOON_REACTOR_NUM=1
LUMOON_WORKER_NUM=4
LUMOON_BACKLOG=128
LUMOON_DISPATCH_MODE=1

###pid_file

 LUMOON_PID_FILE=/path/to/lumoon.pid

default is at /lumen/storage/logs/swoole.pid

###gzip

 LUMOON_GZIP=1

level is in the range from 1 to 9, bigger is compress harder and use more CPU time.

 LUMOON_GZIP_MIN_LENGTH=1024

Sets the mINImum length of a response that will be gzipped.

###deal_with_public

Use this ONLY when developing

 LUMOON_DEAL_WITH_PUBLIC=true

###Swoole

Eexample:

 LUMOON_HOST=0.0.0.0

Default host is 127.0.0.1:9050

See Swoole's document:

简体中文

English

##Work with nginx

server {
	listen       80;
	server_name  localhost;

	root /path/to/lumoon/public;

	location ~ \.(png|jpeg|jpg|gif|css|js)$ {
		break;
	}

	location / {
		proxy_set_header   Host $host:$server_port;
		proxy_set_header   X-Real-IP $remote_addr;
		proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_http_version 1.1;

		proxy_pass http://127.0.0.1:9050;
	}
}

#License MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.