Skip to main content

H2O HTTP server library

Project description

The pyh2o module provides Python binding for the H2O HTTP server. Specifically, it provides high performance HTTP 1/2 and websocket server for Python.


pip install pyh2o


Clone the repository, initialize submodules by git submodule update --init --recursive.

  • Build: python build
  • Test: python test
  • Clean: python clean

End to end test brings up a real server and make requests to it.


Below is an example of serving static content.

import h2o
import socket

class Handler(h2o.Handler):
    def on_req(self):
        self.res_status = 200
        self.send_inline(b'Hello, world!')
        return 0

config = h2o.Config()
host = config.add_host(b'default', 65535)

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
sock.bind(('', 8888))

loop = h2o.Loop()
loop.start_accept(sock.fileno(), config)
while == 0:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyh2o, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pyh2o-0.0.4-cp27-cp27mu-manylinux1_x86_64.whl (1.7 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size pyh2o-0.0.4-cp35-cp35m-manylinux1_x86_64.whl (1.7 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size pyh2o-0.0.4.tar.gz (16.7 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page