[Twisted-Python] Using ResourceSubscription with vhost

Alex Levy mesozoic at polynode.com
Fri Jul 25 16:26:17 MDT 2003


I am using twisted-web to serve a number of virtual hosts.  I'd like one of
these virtual hosts to point to a ResourceSubscription I've got set up.

The code in the first example works, the second does not.

--- This works - /etc/twisted-web/local.d/50vhost.py ---

rs = distrib.ResourceSubscription('unix', 'socketpath')
file = static.File('/somewhere')
file.putChild('rs', rs)
root.addHost('my.domain.com', file)

--- This doesn't ---

rs = distrib.ResourceSubscription('unix', 'socketpath')
root.addHost('my.domain.com', rs)

--- snip snip ---

If I use the second example, navigating to http://my.domain.com/anything
results in a 'No such child resource' error message. So, am I missing
something that should be more obvious, or is this a real bug?

-- 
Alex Levy
WWW: http://mesozoic.geecs.org
 
"Never let your sense of morals prevent you from doing what is right."
 -- Salvor Hardin, Isaac Asimov's _Foundation_




More information about the Twisted-Python mailing list