1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/BaseHTTPRequestHandler/SimpleWithLogin.py Thu May 27 22:16:53 2004 +0000
1.3 @@ -0,0 +1,22 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +from WebStack.Adapters import BaseHTTPRequestHandler
1.7 +from Simple import SimpleResource
1.8 +from LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.9 +import BaseHTTPServer
1.10 +
1.11 +# Special magic incantation.
1.12 +
1.13 +handler = BaseHTTPRequestHandler.HandlerFactory(
1.14 + LoginRedirectResource(
1.15 + "http://localhost:8081",
1.16 + "http://localhost:8080",
1.17 + SimpleResource(),
1.18 + LoginRedirectAuthenticator("horses")
1.19 + )
1.20 +)
1.21 +address = ("", 8080)
1.22 +server = BaseHTTPServer.HTTPServer(address, handler)
1.23 +server.serve_forever()
1.24 +
1.25 +# vim: tabstop=4 expandtab shiftwidth=4