CPP FastCGI

其他类别 2025-07-28

cpp-fastcgi

该项目的目的是创建功能强大的C ++ FastCGI库,其中每个请求都在线程中运行。

守护程序示例

Debug Request"); for (auto& param : requestInfo->params) { print(param.first + " = " + param.second + "
n"); } print(""); end(0); } }; int main(int argc, char* argv[]) { RequestHandler requestHandler; requestHandler.registerPath("^/debug", RequestPath::RegexMatch); return CppSystemRT::Daemon::exec("127.0.0.1", "9000", requestHandler); }">
# include < CppSystemRT.hpp >
# include < CppFastCGI.hpp >

using namespace CppFastCGI ;

class DebugRequest : public Request {
public:
	DebugRequest (RequestInfo* requestInfo): Request(requestInfo) {}

protected:	
	void run () {
		print ( " Content-type: text/html; charset=utf-8 rnrn " );
		print ( " Debug Request " );
		for ( auto & param : requestInfo-> params ) {
			print (param. first + " = " + param. second + " 
n "
); } print ( " " ); end ( 0 ); } }; int main ( int argc, char * argv[]) { RequestHandler requestHandler; requestHandler. registerPath ( " ^/debug " , RequestPath::RegexMatch); return CppSystemRT::Daemon::exec( " 127.0.0.1 " , " 9000 " , requestHandler); }
下载源码

通过命令行克隆项目:

git clone https://github.com/XamanSoft/CPP-FastCGI.git