Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > efe60a74a55b1603654f3f258ba7199d > files > 3181

python3-twisted-19.2.1-1.1.mga7.armv7hl.rpm

# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
This demonstrates a web server which can run behind a name-based virtual hosting
reverse proxy.  It decodes modified URLs like:

    host:port/vhost/http/external-host:port/

and dispatches the request as if it had been received on the given protocol,
external host, and port.

Usage:
    python web.py
"""

from twisted.internet import reactor
from twisted.web import static, server, vhost, twcgi, script

root = static.File("static")
root.processors = {
            '.cgi': twcgi.CGIScript,
            '.epy': script.PythonScript,
            '.rpy': script.ResourceScript,
}
root.putChild('vhost', vhost.VHostMonsterResource())
site = server.Site(root)
reactor.listenTCP(1999, site)
reactor.run()