We explored Boa in one of our earlier articles. h2o is a similar server software for HTTP and HTTP2. It also comes with a packaged SSL stack for secure connections. h2o is a highly efficient implementation with benchmarks showing better performance figures than nginx.
Features
- HTTP 1.0, 1.1, 2 support
- Websocket
- TLS (LibreSSL bundled, otherwise OpenSSL ver >= 1.0.2)
- Static file serving
- Reverse proxy
- Access-logging
- Graceful restart and self-upgrade
- Optionally install as a library you can use in your application
Installation
Run the following commands to install h2o on Ubuntu:
$ sudo apt-get install cmake $ git clone https://github.com/h2o/h2o $ cd h2o $ cmake -DWITH_BUNDLED_SSL=on . $ make $ sudo make install
By default h2o will be installed under /usr/local.
Usage
A sample configuration file is left during installation. To run h2o manually:
$ /usr/local/bin/h2o -c examples/h2o/h2o.conf
The sample configuration starts a server that listens to port 8080 (HTTP) and port 8081 (HTTPS).
On GitHub: h2o
One thought on “h2o: HTTP & HTTP2 server in C”