多语言通用服务器 hi-nginx V1.0.2 发布

栏目: 服务器 · Nginx · 发布时间: 8年前

内容简介:多语言通用服务器 hi-nginx V1.0.2 发布

hi-nginx是是基于nginx最新版开发的多语言通用服务器,它不仅继承了nginx的全部功能,100%兼容nginx,而且支持多种语言直接开发web应用。不仅性能强劲,而且易于开发,部署方便。目前,hi-nginx直接支持使用c++和 python 进行web应用开发,而无需其他后端应用服务器。hi-nginx本身就合并了后端服务器的功能。

多语言通用服务器 hi-nginx V1.0.2 发布

hi-nginx还提供两个基于tengine和openresty的分支版本。因此,hi-nginx实际上还支持直接使用 lua 语言进行web开发。

此次发布的是hi-nginx-1.0.2。主要更新如下:

  • 更新nginx至最新版1.13.1

  • 添加基于 redis 和hiredis的session会话机制

  • 添加基于boost.python的python语言支持

c++例子:

#include "servlet.hpp"
namespace hi{
class hello : public servlet {
    public:

        void handler(request& req, response& res) {
            res.headers.find("Content-Type")->second = "text/plain;charset=UTF-8";
            res.content = "hello,world";
            res.status = 200;
        }

    };
}

extern "C" hi::servlet* create() {
    return new hi::hello();
}

extern "C" void destroy(hi::servlet* p) {
    delete p;
}

python例子:

            location = /pyecho {
                hi_python_content "hi_res.status(200)\nhi_res.content('hello,world')" ;
            }
            location ~ \.py$  {
                hi_python_script python;
            }

更多使用说明请移步:


以上所述就是小编给大家介绍的《多语言通用服务器 hi-nginx V1.0.2 发布》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

APIs

APIs

Daniel Jacobson、Greg Brail、Dan Woods / O'Reilly Media / 2011-12-24 / USD 24.99

Many of the highest traffic sites get more than half of their traffic not through the browser but through the APIs they have created. Salesforce.com (more than 50%) and Twitter (more than 75% fall int......一起来看看 《APIs》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

html转js在线工具
html转js在线工具

html转js在线工具