tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

trickle.py (536B)


      1 import time
      2 
      3 def main(request, response):
      4    response.add_required_headers = False # Don't implicitly add HTTP headers
      5    response.writer.write_status(200)
      6    response.writer.write_header("Content-Type", "text/html")
      7    response.writer.end_headers()
      8 
      9    for b in b'<?xml version="1.0" encoding="windows-1251"?':
     10        response.writer.write(bytes([b]))
     11        time.sleep(0.05)
     12    response.writer.write(b'>\n<p>Normal XML declation as slow byte-by-byte trickle</p>\n<p>Test: \xE6</p>\n<p>If &#x0436;, XML decl takes effect</p>')