[Twisted-web] Run Nevow and XMLRPC on a single port?

David Reid dreid at dreid.org
Thu Dec 14 09:53:47 CST 2006

On Dec 14, 2006, at 3:45 AM, Phil Mayers wrote:

> Marian Schubert wrote:
>>> I believe you can do this:
>>> class Xrpc(xmlrpc.XMLRPC):
>>>    def xmlrpc_echo(self, arg):
>>>      return arg
>>> xrpc = Xrpc()
>>> page = NevowRootPage()
>>> page.putChild('RPC2', xrpc)
>> just make sure xmlrpc resource isn't behind nevow.guard
> It's a shame you can't persuade guard by URL arguments to not try  
> an HTTP redirect to HTML login, but issue an HTTP auth challenge.
> Bizarrely nevow guard will accept http auth credentials if they're  
> given, but I don't know of a single HTTP client that will submit  
> them without getting the 401 first.

Most programatic clients can be told to submit basic auth credentials  
without a 401, but digest and negotiate are much harder.  It doesn't  
matter though, because nevow.guard only supports basic auth afaik.  I  
seem to recall that xmlrpclib supports http://user:pass@host/  
syntax.  twisted.web.xmlrpc.Proxy also supports this, as well as  
explicit keyword arguments for user and password.

David Reid

More information about the Twisted-web mailing list