GithubHelp home page GithubHelp logo

matt-42 / h2o Goto Github PK

View Code? Open in Web Editor NEW

This project forked from h2o/h2o

2.0 3.0 1.0 2.98 MB

H2O - an optimized HTTP server with support for HTTP/1.x and HTTP/2

License: MIT License

HTML 0.02% ApacheConf 0.06% C 93.89% Shell 0.03% Perl 5.00% Perl 6 1.00%

h2o's Introduction

H2O - an optimized HTTP server with support for HTTP/1.x and HTTP/2

Build Status

Copyright (c) 2014,2015 DeNA Co., Ltd., Kazuho Oku, Tatsuhiko Kubo, Domingo Alvarez Duarte, Nick Desaulniers, Marc Hörsken, Masahiro Nagano, Jeff Marrison

H2O is a very fast HTTP server written in C. It can also be used as a library.

This is the README for H2O version 1.0.1-alpha1 (HEAD).

License

The MIT License.

Includes third-party softwares (also licensed under the MIT license): klib, picohttpparser, hpack-huffman-table.h.

Features

  • HTTP/1.0, HTTP/1.1
  • uses PicoHTTPParser
  • persistent connections
  • chunked encoding
  • HTTP/2
  • supports the final version, draft 14 and 16
  • negotiation methods: NPN, ALPN, Upgrade, direct
  • dependency and weight-based prioritization
  • server push
  • WebSocket
  • uses wslay
  • only usable at library level
  • TLS
  • uses OpenSSL
  • forward secrecy
  • AEAD ciphers
  • OCSP stapling (automatically enabled)
  • session resumption and session tickets (internal memory)
  • static file serving
  • conditional GET using last-modified / etag
  • directory listing
  • mime-type configuration
  • reverse proxy
  • HTTP/1 only (no HTTPS)
  • persistent upstream connection
  • access-logging
  • apache-like format strings
  • graceful restart and self-upgrade
  • via Server::Starter

Using the Standalone Server

Installation

Following softwares are required to build the standalone server. It is likely that you would be possible to find and install them as part of your operation system (by running yum, apt-get, brew, etc. depending on the OS).

Download and extract a source release from here, or clone the Git repository.

Run the commands below. The last command installs h2o (the standalone server) to usr/local.

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local .
$ make
$ sudo make install

Type make test to run the unit tests (note that extra components are required for running the tests; a complete list of prerequisites can be found in the before_script section of .travis.yml).

Running the Server

First, let's try running the server using a configuration file included in the examples/ directory. The command below invokes the standalone server using examples/h2o/h2o.conf, which directs the server to listen on port 8080. Try accessing http://127.0.0.1:8080/.

$ h2o -c examples/h2o/h2o.conf

Use --help to print a list of command line options and configuration directives that can be used.

$ ./h2o --help

Building the Library

H2O can also be used as a software library with libuv version 1.0.0. Note that prior versions of libuv cannot be used due to massive changes to the APIs in 1.0.0.

Examples can be found within the examples/ directory.

For the time being, using libh2o as a submodule is the recommend way.

$ cmake .
$ make libh2o

Benchmarks

Remote Benchmark

The scores were recorded on Amazon EC2 running two c3.8xlarge instances (server and client) on a single network placement.

benchmark results

note: for reverse-proxy tests, another H2O process running on the same host was used as the upstream server

Local Benchmark

The scores (requests/second.core) were recorded on Ubuntu 14.04 (x86-64) / VMware Fusion 7.1.0 / OS X 10.9.5 / MacBook Pro 15" Early 2013

HTTP/1.1

Server \ size of content 6 bytes 4,096 bytes
h2o/0.9.0 75,483 59,673
nginx/1.7.9 (conf) 37,289 43,988

note: wrk -c 500 -d 30 -t 1

HTTP/2

Server \ size of content 6 bytes 4,096 bytes
h2o/0.9.0 (conf) 272,300 116,022
tiny-nghttpd (nghttpd @ ab1dd11) 198,018 93,868
trusterd @ cff8e15 167,306 67,600

note: h2load -c 500 -m 100 -n 2000000

Further Reading

h2o's People

Contributors

0-wiz-0 avatar cubicdaiya avatar deepakprakash avatar hirose31 avatar kazeburo avatar kazuho avatar kimoto avatar lestrrat avatar maksqwe avatar matt-42 avatar mattn avatar mback2k avatar mingodad avatar pborreli avatar stanback avatar suzukaze avatar swinghu avatar syohex avatar tatsuhiro-t avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

guoyu07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.