Created
August 13, 2013 11:19
-
-
Save grejppi/6220174 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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