1
from twisted.web.resource import Resource
4
class ReportResource(Resource):
6
def render_GET(self, request):
8
_, host, port = request.getHost()
9
url = request.prePathURL()
11
secure = (request.isSecure() and "securely") or "insecurely"
14
<HEAD><TITLE>Welcome To Twisted Python Reporting</title></head>
16
<BODY><H1>Welcome To Twisted Python Reporting</H1>
18
<LI>The path to me is %(path)s
19
<LI>The host I'm on is %(host)s
20
<LI>The port I'm on is %(port)s
21
<LI>I was accessed %(secure)s
22
<LI>A URL to me is %(url)s
23
<LI>My URI to me is %(uri)s
28
resource = ReportResource()