Ticket #26 (closed enhancement: fixed)
wokkel.client.clientCreator should accept a connector class as an argument
| Reported by: | jack | Owned by: | ralphm |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | generic | Keywords: | |
| Cc: |
Description
On Mac OS X there is a bug that prevents SRVConnector from working properly. I have written it up in Twisted ticket #3456.
To work around this I need to use a custom connector, but clientCreator does not accept the connector to use as an argument. To get around *that* I have to implement my own clientCreator.
It would be helpful if you could pass in a connector wherever one is needed.
Change History
Note: See
TracTickets for help on using
tickets.

Here's what I'm using to work around the bug currently. Can we get this into wokkel and into twisted words?
class XMPPConnector(SRVConnector): """Connector that replaces xmpp-client with port 5222 if SRV lookup fails. This is needed to work around buggy OSes that still use jabber-client in /etc/services (OS X 10.5.x, I'm looking at you). """ def pickServer(self): host, port = SRVConnector.pickServer(self) if port == 'xmpp-client': port = 5222 return host, port def createClient(factory): domain = factory.authenticator.jid.host c = XMPPConnector(reactor, 'xmpp-client', domain, factory) c.connect() return factory.deferred