This gist contains a really stupid implementation of a Twisted HTTP/2 client. It opens a connection, uses ALPN/NPN to negotiate HTTP/2, and then sends a single HTTP/2 GET request to the /ip
endpoint.
To execute this:
- Create a clean virtual environment.
- Install the requirements:
pip install -r requirements.txt
. - Install the development version of Twisted that contains the
nextProtocols
code. - Execute the code using
python h2test.py
.