Handmade HTTP Project (HHTTPP)
Free range artisnal HTTP
HHTTPP is an educational tool that is part of a series of blog posts being made to help teach about HTTP servers, and how to build one from scratch in python. The goals of the project are to build a package that:
- Can be installed from pip (uploaded to pypi)
- Can do all basic types of requests and responses (not every response code supported)
- Have a simple CLI to make it easy to use
Quick-start
Installation
From source
- Clone this repo: (put github/source code link here)
- Run
pip install .orsudo pip3 install .in the root directory - Confirm it is working by running
hhttpp -hwhich should show you the text you see in usage
From PyPi
- Run
pip install hhttpp - Confirm it is working by running
hhttpp -hwhich should show you the text you see in usage
Usage
HHTTPP has a CLI that you can use, the usage string can be found below:
hhttpp
Free range artisnal HTTP server
Usage:
hhttpp [-h] [-v] [-p PORT] [-f PROXY_FOLDER]
Options:
-h, --help Show this help message and exit
-v, --version Show program's version number and exit
-p PORT, --port PORT The port to start the server on
-f PROXY_FOLDER, --folder PROXY_FOLDER
Lets you specify a folder to proxy instead of cwd
By default just running hhttpp in a folder will proxy the current folder (unless otherwise specified) you're in and find an available port to bind to if one is not specified (starting with 8338).
API Examples
The simplest way to use hhttpp as an API is to import the Server object, and let it run:
from hhttpp import Server
Server().start_server()
The server object in this case will have all the logs and server state, so if you want to change behaviours, modify it's initialization. For example initializing while only allowing certain files to be visible to the server:
from hhttpp import Server
s = Server(file_list = ["index.html", "/css/main.css"])
s.start_server()
Metadata
Release files for hhttpp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hhttpp-0.1.0.tar.gz | 9.1 kB | Without provenance | Details for hhttpp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hhttpp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for hhttpp-0.1.0-py3-none-any.whl |
Total release size: 18.1 kB
Release files / hhttpp-0.1.0.tar.gz
| Download URL | hhttpp-0.1.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ef060691c253adf9f96d00d16a2525bd5bc64f151908668f22b82a512c74349
|
|
BLAKE2b-256 checksum How to use checksums |
469389a1e50c9428e6c6ac37e4e42043138030d66baadd5cb0bafc843e325e08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / hhttpp-0.1.0-py3-none-any.whl
| Download URL | hhttpp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3614691339f43e3b37ce58047b699ceeb1de18f63c4d1d31a9b108903b2bf822
|
|
BLAKE2b-256 checksum How to use checksums |
6280896b0e156dc72201cca8eff57c6e5804e1554c6fa8bbe0ca15be83d739ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for hhttpp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.