print(self.get_cookie('scheme'))
print(self.get_cookie('netloc'))
print(self.get_cookie('urlpath'))
print(slug)
response = requests.get(slug)
headers = response.headers
doctype = None
if '<!doctype' in response.content.lower()[:9]:
    doctype = response.content[:response.content.find('>') + 1]
if 'content-type' in headers:
    self.set_header('Content-type', headers['content-type'])
if 'length' in headers:
    self.set_header('length', headers['length'])
self.write(response.content)
How to write a web proxy in Python