I previously used the following code with TwistedWeb2 0.1:
site = server.Site(Toplevel()) reactor.listenTCP(1080, http.HTTPFactory(site)) reactor.run()
This no longer works in 2.0.2. If I replace http.HTTPFactory with channel.HTTPFactory or channel.http.HTTPFactory, I don't get errors, but I get "405 Method Not Allowed" for any URL Resource I try to visit.
What is the proper way to do the above in 2.0.2?
Thanks, Lenny
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Lenny G Arbage wrote:
I previously used the following code with TwistedWeb2 0.1:
site = server.Site(Toplevel()) reactor.listenTCP(1080, http.HTTPFactory(site)) reactor.run()
This no longer works in 2.0.2. If I replace http.HTTPFactory with channel.HTTPFactory or channel.http.HTTPFactory, I don't get errors, but I get "405 Method Not Allowed" for any URL Resource I try to visit.
What is the proper way to do the above in 2.0.2?
channel.HTTPFactory(server.Site(rootresource)) is the proper way, and I've just verified that it works on web2 0.2 (it's not 2.0.2.) Without seeing the implementation of TopLevel I don't have a clue what the problem might be, except for some error on your part.
- -David
- -- "Usually the protocol is this: I appoint someone for a task, which they are not qualified to do. Then, they have to fight a bear if they don't want to do it." -- Glyph Lefkowitz