Commit 2c76027e authored by Denis Bilenko's avatar Denis Bilenko

remove examples/httpserver.py

parent 1e03e4b1
#!/usr/bin/python
"""HTTP server example.
Uses libevent API directly and thus may be dangerous.
WSGI interface is a safer choice, see examples/wsgiserver.py.
"""
from gevent import http
def callback(request):
print request
if request.uri == '/':
request.add_output_header('Content-Type', 'text/html')
request.send_reply(200, "OK", '<b>hello world</b>')
else:
request.add_output_header('Content-Type', 'text/html')
request.send_reply(404, "Not Found", "<h1>Not Found</h1>")
print 'Serving on 8088...'
http.HTTPServer(('0.0.0.0', 8088), callback).serve_forever()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment