Example HTTP/2 server implemented in Python
Deploy the app
export DOMAIN=my.cf.app.domain
cf push -f app-manifest.yml --var domain=$DOMAIN
cf push --no-route python-http2-test --buildpack https://github.com/cloudfoundry/python-buildpack
# my.cf.app.domain is used as an example for demonstration purpose
cf map-route python-http2-test my.cf.app.domain --hostname python-http2-test --app-protocol http2
curl -v --http2-prior-knowledge https://python-http2-test.my.cf.app.domain
The app supports HTTP/1.1 and HTTP/2 H2C if requested explicitly, i.e. no connection upgrade.
pipenv install -r requirements.txt
PORT=8080 pipenv run python3 main.py
curl -v --http2-prior-knowledge http://localhost:8080