Skip to content
Branch: master
Find file History
Pull request Compare This branch is 22 commits ahead of toniz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
cocgi_lib
CMakeLists.txt
README.md
backend.cpp
backend.h
main.cpp
make.sh
restart.sh
test.sh

README.md

Coroutine Fastcgi

cocgi is a coroutine fastcgi using Tencent Libco Library. Use Muduo Buffer.cpp for tcp receive buffer. Use Some Cgicc Files to parse http request. Modify the BackendProc Class then You can pass the http request to back-end service.


INSTALL

yum install scons -y
scons

Or run:

sh make.sh

Usage

./cocgi [IP] [PORT] [TASK_COUNT] [PROCESS_COUNT]
./cocgi [IP] [PORT] [TASK_COUNT] [PROCESS_COUNT] -d   # daemonize mode

Linux Version > 3.9, support for the SO_REUSEPORT socket option. We can add process on runtime.

./cocgi 127.0.0.1 6888 30 1 -d
./cocgi 127.0.0.1 6888 30 1 -d
./cocgi 127.0.0.1 6888 30 1 -d
./cocgi 127.0.0.1 6888 30 1 -d
...

cocgi is a synchronize model, must use short-link.

  • Test 测试

Test on Centos 6/7

You can’t perform that action at this time.