Skip to content

Instantly share code, notes, and snippets.

@thevkozlovsky
Created July 2, 2014 18:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thevkozlovsky/2f342ea915e794497293 to your computer and use it in GitHub Desktop.
Save thevkozlovsky/2f342ea915e794497293 to your computer and use it in GitHub Desktop.
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()
@hidayatrakhman
Copy link

salam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment