[Twisted-Python] Twisted newb I can't add a cred checker to a Factory class

class ProxyIncomingProtocol(Protocol): ..... class ProxyOutgoingProtocol(Protocol): ..... class ProxyFactory(Factory): protocol = ProxyIncomingProtocol class SimplePerspective(pb.Avatar): def perspective_echo(self, text): print 'echoing',text return text def logout(self): print self, "logged out" class SimpleRealm: implements(IRealm) def requestAvatar(self, avatarId, mind, *interfaces): if pb.IPerspective in interfaces: avatar = SimplePerspective() return pb.IPerspective, avatar, avatar.logout else: raise NotImplementedError("no interface") portal = Portal(SimpleRealm()) checker = InMemoryUsernamePasswordDatabaseDontUse() checker.addUser("guest", "password") portal.registerChecker(checker) proxy_factory = proxy.ProxyFactory() # ??????? how can I add the portal to the factory? internet.GenericServer(cometsession.Port, factory=proxy_factory, resource=root_resource, childName="tcp", interface=INTERFACE).setServiceParent(serviceCollection)

On 26 Jan, 09:40 pm, theiklabs@gmail.com wrote:
It doesn't make any sense to ask how to "add a portal to a factory". Your protocol implementation needs to support twisted.cred. In the code you included, I don't see any evidence of such support. Also, with the unexplained mix of two "proxying" protocols (with their implementations omitted), various classes from Twisted Spread (but not enough to actually establish a PB connection as far as I can tell), and something called "cometsession", it's hard to tell what you're actually trying to accomplish, so I don't have any more specific suggestions to make. Jean-Paul

On 26 Jan, 09:40 pm, theiklabs@gmail.com wrote:
It doesn't make any sense to ask how to "add a portal to a factory". Your protocol implementation needs to support twisted.cred. In the code you included, I don't see any evidence of such support. Also, with the unexplained mix of two "proxying" protocols (with their implementations omitted), various classes from Twisted Spread (but not enough to actually establish a PB connection as far as I can tell), and something called "cometsession", it's hard to tell what you're actually trying to accomplish, so I don't have any more specific suggestions to make. Jean-Paul
participants (2)
-
adamjamesdrew same
-
exarkun@twistedmatrix.com