这是webcppd升级为httpevent后的第二个更新。
主要更新:
解决内存多余消耗问题
解决空值响应问题
httpevent 是webcppd的继承者,在多个方面增强了后者,并且融入了lua开发要素,可同时支持使用c++和lua进行web开放。
C++ HELLOWORLD:
#include <httpevent.hpp>
namespace httpevent {
class hello : public view {
void handler(const request& req, response& res) {
res.send_head("Content-Type", "text/plain;charset=UTF-8")
.send_body("hello,world");
}
};
}
lua HELLOWORLD:
local hello={}
function hello.main()
httpevent.response:send_head("Content-Type", "text/plain;charset=UTF-8")
:send_body('hello,world')
end
return hello
依赖:
libevent v2.1.8+
Poco framework v1.6+
lua devel v5.1+
openssl devel
开发例子请参考:https://github.com/webcpp/httpevent/tree/master/plugin
引用来自“gznovice”的评论
看文档这个的内核是poco库,poco的吸引力更大点。。引用来自“webcpp”的评论
httpevent服务器内核采用的libevent2,之前的webcppd采用的Poco。前者的性能比后者好。poco对httpevent而言只是一个普通的C++工具库。引用来自“gznovice”的评论
看文档这个的内核是poco库,poco的吸引力更大点。。