tcp-h2-describe
Python library and CLI for running an HTTP/2 proxy that describes each frame
Install
python3 -m pip install --upgrade tcp-h2-describe
Usage
For example, on a machine where there is a local HTTP/2 server running on port 50051:
$ tcp-h2-describe --server-port 50051
Starting tcp-h2-describe proxy server on port 24909
Proxying server located at localhost:50051
...
$ # OR
$ python -m tcp_h2_describe --server-port 50051
Starting tcp-h2-describe proxy server on port 24909
Proxying server located at localhost:50051
...
Options also exist to customize the port where the tcp-h2-describe proxy
runs as well as the remote server that is being proxied:
$ python -m tcp_h2_describe --help
usage: tcp-h2-describe [-h] [--proxy-port PROXY_PORT]
[--server-host SERVER_HOST] [--server-port SERVER_PORT]
Run `tcp-h2-describe` reverse proxy server. This will forward traffic to a
proxy port along to an already running HTTP/2 server. For each HTTP/2 frame
forwarded (either client->server or server->client) a description will be
printed to the console explaining what each byte in the frame means.
optional arguments:
-h, --help show this help message and exit
--proxy-port PROXY_PORT
The port that will be used for running the "describe"
proxy. (default: 24909)
--server-host SERVER_HOST
The hostname for the server that is being proxied.
(default: None)
--server-port SERVER_PORT
The port for the server that is being proxied.
(default: 80)
To use directly from Python code
import tcp_h2_describe
proxy_port = 13370
server_port = 50051
tcp_h2_describe.serve_proxy(proxy_port, server_port)
# OR: Spawn a thread to avoid blocking
import threading
server_thread = threading.Thread(
target=tcp_h2_describe.serve_proxy,
args=(proxy_port, server_port),
)
server_thread.start()
See example output when proxying an HTTP server and a gRPC server.
Additionally, the tcp-h2-describe proxy supports the proxy protocol.
Development
To work on adding a feature or to run the tests, see the DEVELOPMENT doc for more information on how to get started.
License
tcp-h2-describe is made available under the Apache 2.0 License. For more
details, see the LICENSE.
Metadata
Release files for tcp-h2-describe 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 | |
|---|---|---|---|---|
| tcp-h2-describe-0.1.0.tar.gz | 19.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tcp_h2_describe-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 43.4 kB
Release files / tcp-h2-describe-0.1.0.tar.gz
| Download URL | tcp-h2-describe-0.1.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d2e8acbab348d4fc3359b18c9f8e63aee652d68c13dc4547b46c9fcbf7debd7
|
|
BLAKE2b-256 checksum How to use checksums |
643ffc4020b443b72bee4d1a0588dd7a7995df585afeb11c3f0a402f62a1acec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.33.0 CPython/3.7.3
|
Release files / tcp_h2_describe-0.1.0-py2.py3-none-any.whl
| Download URL | tcp_h2_describe-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
635f9652dfa33b823c3e04f5285d318065d9ae49e71cd71556f7112988e235df
|
|
BLAKE2b-256 checksum How to use checksums |
d562c59a93e978d9ab31205424763b834008fc360616188000520dff4231ddcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.33.0 CPython/3.7.3
|
Security for tcp-h2-describe 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.