Skip to content

Instantly share code, notes, and snippets.

@grejppi
Created August 13, 2013 11:19
Show Gist options
  • Save grejppi/6220174 to your computer and use it in GitHub Desktop.
Save grejppi/6220174 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import cherrypy
import random
class Root(object):
def index(self):
cherrypy.response.headers['Content-Type'] = 'text/plain'
def noise():
while True:
a = []
for i in range(1024):
a.append(chr(random.randint(0, 255)))
yield ''.join(a)
return noise()
index._cp_config = {'response.stream': True}
index.exposed = True
cherrypy.quickstart(Root())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment