Created
July 2, 2014 18:22
-
-
Save thevkozlovsky/2f342ea915e794497293 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
from twisted.web import server, resource | |
from twisted.internet import reactor | |
class HelloResource(resource.Resource): | |
isLeaf = True | |
def render_GET(self, request): | |
request.setHeader("content-type", "text/plain") | |
return "I am a stupid HTTP server!" | |
reactor.listenTCP(8080, server.Site(HelloResource())) | |
reactor.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
salam