1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

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

本帖由 漂亮的石头2017-06-02 发布。版面名称:软件资讯

  1. 漂亮的石头

    漂亮的石头 版主 管理成员

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

    [​IMG]

    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 发布下载地址
     
正在加载...