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

"""
Template for server supporting HTTP1.x

Script to xxx

Dependencies:
    pip3 install requests termcolor
"""

# Disable TLS warning when validation is disabled when requests is used
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)
# Configure proxy to debug request sent using requests and disable validation of the TLS certificate
proxies = { "http" : "http://127.0.0.1:8080", "https" : "http://127.0.0.1:8080" }


def main():
    sess = requests.Session()
    sess.headers.update({"Cookie": "xxx"})
    print(colored(f"Start processing...", "magenta"))
    try:
        response = sess.get("https://www.google.com", verify=False, timeout=60) # proxies=proxies
        print(response.status_code)
        print(len(response.text))
    except requests.exceptions.Timeout:
        print("Timeout")    


if __name__ == "__main__":
    main()
