Skip to content

nekipelov/hserv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hserv

Build status: Build Status

Is a library for asynchronous http applications based on Boost.Asio. Currently supported:

  • http (0.9, 1.0, 1.1)
  • https
  • fastcgi (stdin/stdout, unix sockets, tcp/ip sockets)

Quick start

Simple C++11 application:

#include <libahttp/httpserver.h>
#include <libahttp/context.h>

using namespace libahttp;

int main(int, char**)
{
    auto handler = [](boost::shared_ptr<Context> context) {
        auto &response = context->response();
        response.setStatus( Response::Ok );
        response.addHeader("Content-type", "text/html" );
        response.setContent("<h1>Hello world!</h1>");
        context->asyncDone();
    };

    HttpServer("0.0.0.0", 3000, handler).run();

    return 0;
}

TODO

  • SCGI
  • SPDY
  • Documentation

About

Library for http applications based on Boost.Asio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published