#!/usr/bin/env python
import httpx
from termcolor import colored

"""
Template for server supporting HTTP2 only

Script to xxx

Dependencies:
    pip3 install httpx[http2] termcolor
"""

# Configure proxy to debug request sent using httpx
proxies = { "http" : "http://127.0.0.1:8080", "https" : "http://127.0.0.1:8080" }


def main():
    print(colored(f"Start processing...", "magenta"))
    with httpx.Client(headers={"Content-Type":"application/json; charset=utf-8"}, verify=False, http2=True) as client: # proxies=proxies
        response = client.get("https://http2.akamai.com/demo") 
        print(response.status_code)
        print(len(response.text))
    pass


if __name__ == "__main__":
    main()
