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.
Installation
pip install pyh2o
If binary distribution for your platform is not provided, you will need cmake>=2.8.11 to install.
Development
Clone the repository, initialize submodules by git submodule update --init --recursive
.
Build:
python setup.py build
Test:
python setup.py test
Clean:
python setup.py clean
End to end test brings up a real server and make requests to it.
Example
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)
host.add_path(b'/plaintext').add_handler(Handler)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
sock.bind(('127.0.0.1', 8888))
sock.listen(0)
loop = h2o.Loop()
loop.start_accept(sock.fileno(), config)
while loop.run() == 0:
pass
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pyh2o-0.0.6.tar.gz
.
File metadata
- Download URL: pyh2o-0.0.6.tar.gz
- Upload date:
- Size: 16.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af75ffa8ced82dfa6e6027ae56e12bf24fca7edf5752a97894fb83a1e826563b |
|
MD5 | de6501a1fe1e2e292b16ade11c95fd18 |
|
BLAKE2b-256 | 4e48ff2b61150b5743778b9d2b7551c1cef85df30364e010fa65768424aac8cb |
File details
Details for the file pyh2o-0.0.6-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b8a42a1ad8446fcd1c8732709503fdd230a704c4a96451a6bde0aab3d70f116 |
|
MD5 | 2be9023ff9e4ea96e026907694dd752b |
|
BLAKE2b-256 | 732e243999558196f9cbb38d5287ef32660ac37c0f51ea19aca642ab1d5c5b37 |
File details
Details for the file pyh2o-0.0.6-cp34-cp34m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp34-cp34m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.4m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd00fe2093441a4d61c9d13ea1a9b72d20a3d99b455db88e05fb3a8fea17ae55 |
|
MD5 | 12fef06d138795d69dff8cdc2fe752f1 |
|
BLAKE2b-256 | b80a34914cb739d9b4486fb7d5c4eed38a03f98c43a4238d8c6a239f121b1783 |
File details
Details for the file pyh2o-0.0.6-cp33-cp33m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp33-cp33m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.3m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbeeb4caaa470ee3211e7ebb5fb81dcc61e3aebb0f0a6f6cc237f5d48d941b6a |
|
MD5 | b534ecc77c36ececb4b79cfb27b51c03 |
|
BLAKE2b-256 | 2695638746a1450c6eb21a28f884d2310de126c46a2cbeb1f156ace492a49c34 |
File details
Details for the file pyh2o-0.0.6-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f05f6a9b072b286d1436aeaceb1afc8840e2ed8adf33af1914a9852cf245d512 |
|
MD5 | 214d2e165da0e18429756c5f2da18f8a |
|
BLAKE2b-256 | 8515fb170f07edeb13a4961e0692ec35766aca7b13dc087cc8f87dfd44f2ac44 |
File details
Details for the file pyh2o-0.0.6-cp27-cp27m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp27-cp27m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 2.7m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f756cded13f571573b7003ca9315da1a0c06a3b04c5f248712d11e2821750e5 |
|
MD5 | e917d05167451b9f23ae11fe3f5f6663 |
|
BLAKE2b-256 | 8df6bb92464720e47394d2cb88a6544373dba79e100dc7a6376fe4f0b9b345af |
File details
Details for the file pyh2o-0.0.6-cp26-cp26mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp26-cp26mu-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 2.6mu
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 867673485afd5130091e225ad9c07c86c42113faab325f85421dc5e3b50b4315 |
|
MD5 | 64c41158d6ed647720932255970426b3 |
|
BLAKE2b-256 | 8ca0ae4a9b8de2a3ea28df28b539b1b4953237bef23ae5acc3f29a2cbd357ba6 |
File details
Details for the file pyh2o-0.0.6-cp26-cp26m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyh2o-0.0.6-cp26-cp26m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 2.6m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d61b3cd7b89de89f547be0aecb8e04ed26f56ffc87e04af3c190b65a86e15484 |
|
MD5 | 95bd4f23e51e3180f2d06f04ec74f317 |
|
BLAKE2b-256 | ed9d882d9b438c043293c47a1b28b07c0886db26214eab2f34a845e6f9b8cc8a |