Re: [Twisted-Python] reactor.run hangs

2010-02-15 Thread giskard
Hi all,

i've moved reactor.run() out of the class and put in the main()

in the class i've:

  def addReactor(self):
print 'dentro al run'
factory = client.basicClientFactory(self.jid, 
self.option['jabber']['password'])
print "factory initialized"
factory.addBootstrap(xmlstream.STREAM_AUTHD_EVENT, self.authd)
print 'factory bootsraped'
reactor.connectTCP(self.option['jabber']['server'], 5222, factory)

and in the main():

jabber = MyJabber(options, to_irc)
jabber.addReactor()
reactor.run()

the ouput of the app,

edvige:jabber giskard$ python jabber2irc.py  config.yaml 
dentro al run
factory initialized
factory bootsraped

with tcpdum i see connection to jabber.org, but nothing else.
the presence is not set and so on..


Il giorno 15/feb/2010, alle ore 06.30, Alexandre Quessy ha scritto:

> Hello giskard,
> I suggest you leave the reactor.run() in the if __name__ == "__main__"
> of your application. It's a blocking call, until you call
> reactor.stop().
> Thats make things a lot easier when you need to merge many
> applications, classes, etc. together.
> 
> Next, to start your Jabber client, you should probably do it when
> reactor is running. To do so, you can use a reactor.callLater.
> 
> if __name__ == "__main__":
>  def _later():
># do stuff
>  reactor.callLater(0, _later)
>  reactor.run()
> 
> 
> 2010/2/14 Darren Govoni :
>> I believe reactor.run() never returns and always blocks the calling thread
>> until reactor.stop() is called, afterwhich you cannot call reactor.run()
>> again. Not sure if that helps you though.
>> 
>> On Sun, 2010-02-14 at 22:36 +0100, giskard wrote:
>> 
>> Hi all,
>> 
>> i think i'm not doing things in the right way:
>> 
>> http://paste.debian.net/59855/
>> 
>> this code implement a simple jabber client, if you remove the class
>> defnition
>> and run it (removing also the run def) it works!
>> 
>> but if i 'class' it and run via:
>> http://paste.debian.net/59856/
>> 
>> reactor.run() hangs.
>> 
>> where i'm wrong?
>> 
>> thank you in advance,
>> --
>> ciao,
>> giskard
>> 
>> 
>> 
>> 
>> ___
>> Twisted-Python mailing list
>> Twisted-Python@twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>> 
>> 
>> ___
>> Twisted-Python mailing list
>> Twisted-Python@twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>> 
>> 
> 
> 
> 
> -- 
> Alexandre Quessy
> http://alexandre.quessy.net/
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

--
ciao,
giskard




___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Authenticating with md5 hashed passwords

2010-02-15 Thread Ramiro Alba Queipo
Jean-Paul,

Thanks for your answers. Answers bellow. Also attachments of
client/server application tests.

On Fri, 2010-02-12 at 20:06 +, exar...@twistedmatrix.com wrote:
> On 06:03 pm, r...@cttc.upc.edu wrote:
> >Hello everybody,
> >
> >I am trying to build a a client/server application using Perspective
> >Broker and wanting to authenticate against a PostgreSQL database.
> >Everything works fine if I user plain text passwords, but when trying 
> >to
> >hash then using md5 using
> 
> What do you mean when you say you're using plain text passwords? 
> Authentication involves multiple parties handling the password in 
> multiple ways, and the "plain text"-ness of the password changes from 
> step to step.

I mean that the the server authenticates the client using a NOT HASHED
password. In my case using a VARCHAR field in a PostgreSQL table

> >from hashlib import md5
> >md5Password = md5(password).hexdigest()
> >
> >then it does not authenticate (I use
> >credentials.checkMD5Password(password) at the checker class)
> >
> >Then after reading
> >
> >twisted/spread/pb.py
> >
> >I saw that everything is done in the functions:
> >
> >respond(challenge, password)
> >challenge()
> >
> >and the methods
> >
> >checkMD5Password(self, md5Password)
> >checkPassword(self, password)
> >
> >at the
> >
> >class _PortalAuthChallenger(Referenceable, _JellyableAvatarMixin)
> >
> >By changing digest() with hexdigest(), it works.
> >
> >The question is:
> >
> >I there some way to make it work without making changes at the 'pb.py'
> >module?
> >
> >Yes. I should use md5Password = md5(password).digest() to produce the
> >password, but then I cant authenticate with a 'pure-ftpd' daemon I need
> >to work with.
> >
> >Any alternatives?
> 
> You should register an IUsernameHashedPassword checker with the portal 
> you pass to PBServerFactory and use PBClientFactory.login.  See 
> pbbenchserver.py and pbbenchclient.py for examples of this.  Despite the 

Yes I did so. You can see the attached examples I am testing with

> fact that you're passing a UsernamePassword instance to 
> PBClientFactory.login, the plain text password is never sent over the 
> network.

Yes I Know. You do that at the 'respond(challenge, password)' in
'pb.py', do you?

> 
> Also, IUsernameMD5Password is about to be deprecated, along with the 
> checkMD5Password method of _PortalAuthChallenger.

So, how should I do it in order not to be using deprecated code? I would
like to know some details so that I can have a better understanding of
how authentication is working.


Jean-Paul:

To sum up. I would like to use md5 hashed password, so as the password
can not be read at the server, but as it is at a database table it is
not as terrible as if I where using a simple text file. Furthermore I am
having problems to use a python ftp client with ssl to connect to
'pure-ftpd' with TLS, and in this case, I am really sending password
clear-text over the wire even if using hashed passwords at the server.

Thanks again for your interest

Regards

> 
> Jean-Paul
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 
-- 
Ramiro Alba

Centre Tecnològic de Tranferència de Calor
http://www.cttc.upc.edu


Escola Tècnica Superior d'Enginyeries
Industrial i Aeronàutica de Terrassa
Colom 11, E-08222, Terrassa, Barcelona, Spain
Tel: (+34) 93 739 86 46

-- 
Aquest missatge ha estat analitzat per MailScanner
a la cerca de virus i d'altres continguts perillosos,
i es considera que està net.

#!/usr/bin/python

from twisted.internet import ssl, reactor
from twisted.spread import pb
from twisted.cred.credentials import UsernamePassword

class DefinedError(pb.Error):
pass

def success(message):
print "Message received:",message
reactor.stop()

def failure(error):
t = error.trap(DefinedError)
print "error received:", t
reactor.stop()

def connected(perspective):
perspective.callRemote('echo', "hello world").addCallbacks(success, failure)
print "connected."

factory = pb.PBClientFactory()
reactor.connectSSL('localhost', 2323, factory, ssl.ClientContextFactory())
factory.login(UsernamePassword("raq", "diga33")).addCallbacks(connected, failure)
reactor.run()
#!/usr/bin/env python

from twisted.cred import error
from twisted.cred.credentials import IUsernameHashedPassword, IUsernamePassword
from twisted.cred.checkers import ICredentialsChecker
from twisted.internet.defer import Deferred
from twisted.python import log
from twisted.enterprise import adbapi
from twisted.cred.portal import Portal, IRealm
from twisted.spread import pb
from twisted.internet import reactor
from OpenSSL import SSL
  
from zope.interface import implements

import sys

class DBCredentialsChecker(object):
implements(ICredentialsChecker)

def __init__(self, dbConn):

	self.dbConn = dbConn
self.credentialInterfaces = (IUsernamePassword

Re: [Twisted-Python] Authenticating with md5 hashed passwords

2010-02-15 Thread exarkun
On 09:54 am, r...@cttc.upc.edu wrote:
>Jean-Paul,
>
>Thanks for your answers. Answers bellow. Also attachments of
>client/server application tests.
>
>On Fri, 2010-02-12 at 20:06 +, exar...@twistedmatrix.com wrote:
>>On 06:03 pm, r...@cttc.upc.edu wrote:
>> >Hello everybody,
>> >
>> >I am trying to build a a client/server application using Perspective
>> >Broker and wanting to authenticate against a PostgreSQL database.
>> >Everything works fine if I user plain text passwords, but when trying
>> >to
>> >hash then using md5 using
>>
>>What do you mean when you say you're using plain text passwords?
>>Authentication involves multiple parties handling the password in
>>multiple ways, and the "plain text"-ness of the password changes from
>>step to step.
>
>I mean that the the server authenticates the client using a NOT HASHED
>password. In my case using a VARCHAR field in a PostgreSQL table
>> >from hashlib import md5
>> >md5Password = md5(password).hexdigest()
>> >

I'm confused here.  I don't see this code in your checker implementation 
in the attached code.  Is this code running someplace else?
>> >then it does not authenticate (I use
>> >credentials.checkMD5Password(password) at the checker class)
>> >
>> >Then after reading
>> >
>> >twisted/spread/pb.py
>> >
>> >I saw that everything is done in the functions:
>> >
>> >respond(challenge, password)
>> >challenge()
>> >
>> >and the methods
>> >
>> >checkMD5Password(self, md5Password)
>> >checkPassword(self, password)
>> >
>> >at the
>> >
>> >class _PortalAuthChallenger(Referenceable, _JellyableAvatarMixin)
>> >
>> >By changing digest() with hexdigest(), it works.

Indeed.  `checkMD5Password` needs to be passed the MD5 digest of the 
password, not the hex encoded MD5 digest (despite being documented as 
taking the plaintext password itself).
>> >
>> >The question is:
>> >
>> >I there some way to make it work without making changes at the 
>>'pb.py'
>> >module?
>> >
>> >Yes. I should use md5Password = md5(password).digest() to produce the
>> >password, but then I cant authenticate with a 'pure-ftpd' daemon I 
>>need
>> >to work with.

This seems to be the crux of the matter.  I'm not sure how the PB auth 
code and the FTP auth code interact, though.  Perhaps your FTP code can 
just do its own password hashing?
>> >Any alternatives?
>>
>>You should register an IUsernameHashedPassword checker with the portal
>>you pass to PBServerFactory and use PBClientFactory.login.  See
>>pbbenchserver.py and pbbenchclient.py for examples of this.  Despite 
>>the
>
>Yes I did so. You can see the attached examples I am testing with
>>fact that you're passing a UsernamePassword instance to
>>PBClientFactory.login, the plain text password is never sent over the
>>network.
>
>Yes I Know. You do that at the 'respond(challenge, password)' in
>'pb.py', do you?
>>
>>Also, IUsernameMD5Password is about to be deprecated, along with the
>>checkMD5Password method of _PortalAuthChallenger.
>
>So, how should I do it in order not to be using deprecated code? I 
>would
>like to know some details so that I can have a better understanding of
>how authentication is working.

If you have the plaintext password in the PB server, then you can just 
call `checkPassword` instead of `checkMD5Password` in 
DBCredentialsChecker._cbAuthenticate.

Jean-Paul

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Authenticating with md5 hashed passwords

2010-02-15 Thread Ramiro Alba Queipo
Jean-Paul:

On Mon, 2010-02-15 at 13:25 +, exar...@twistedmatrix.com wrote:
> >>What do you mean when you say you're using plain text passwords?
> >>Authentication involves multiple parties handling the password in
> >>multiple ways, and the "plain text"-ness of the password changes from
> >>step to step.
> >
> >I mean that the the server authenticates the client using a NOT HASHED
> >password. In my case using a VARCHAR field in a PostgreSQL table
> >> >from hashlib import md5
> >> >md5Password = md5(password).hexdigest()
> >> >
> 
> I'm confused here.  I don't see this code in your checker implementation 
> in the attached code.  Is this code running someplace else?

No, of course you can not. This is only a little python script I use to
produce I hashed password that I can put in the VARCHAR field of my
PostgreSQL table. This way I can make 'pure-ftpd' authenticate using md5
hashed passwords, but for that reason I have to change pb.py code at
twisted, swaping '.digest()' with '.hexdigest()'.
That way it works but at the price of having to change original twisted
code, which is not the option I want to support.

> >> >then it does not authenticate (I use
> >> >credentials.checkMD5Password(password) at the checker class)
> >> >
> >> >Then after reading
> >> >
> >> >twisted/spread/pb.py
> >> >
> >> >I saw that everything is done in the functions:
> >> >
> >> >respond(challenge, password)
> >> >challenge()
> >> >
> >> >and the methods
> >> >
> >> >checkMD5Password(self, md5Password)
> >> >checkPassword(self, password)
> >> >
> >> >at the
> >> >
> >> >class _PortalAuthChallenger(Referenceable, _JellyableAvatarMixin)
> >> >
> >> >By changing digest() with hexdigest(), it works.
> 
> Indeed.  `checkMD5Password` needs to be passed the MD5 digest of the 
> password, not the hex encoded MD5 digest (despite being documented as 
> taking the plaintext password itself).

Yes I can understand that. So if I could put ha md5 hashed password in
the database but using digest() instead of hexdigest() I could make the
server authenticate but using 'checkMD5Password()' method directly a the
checker, but as you have said this is going to be deprecated.

> >
> >Yes I Know. You do that at the 'respond(challenge, password)' in
> >'pb.py', do you?
> >>
> >>Also, IUsernameMD5Password is about to be deprecated, along with the
> >>checkMD5Password method of _PortalAuthChallenger.
> >
> >So, how should I do it in order not to be using deprecated code? I 
> >would
> >like to know some details so that I can have a better understanding of
> >how authentication is working.
> 
> If you have the plaintext password in the PB server, then you can just 
> call `checkPassword` instead of `checkMD5Password` in 
> DBCredentialsChecker._cbAuthenticate.

Yes. This is working with plaintext password in the PB server, but not
with md5 hashed passwords, right?

Regards

-- 
Ramiro Alba

Centre Tecnològic de Tranferència de Calor
http://www.cttc.upc.edu


Escola Tècnica Superior d'Enginyeries
Industrial i Aeronàutica de Terrassa
Colom 11, E-08222, Terrassa, Barcelona, Spain
Tel: (+34) 93 739 86 46


-- 
Aquest missatge ha estat analitzat per MailScanner
a la cerca de virus i d'altres continguts perillosos,
i es considera que està net.


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Authenticating with md5 hashed passwords

2010-02-15 Thread exarkun
On 04:32 pm, r...@cttc.upc.edu wrote:
>Jean-Paul:
>
>On Mon, 2010-02-15 at 13:25 +, exar...@twistedmatrix.com wrote:
>> >>What do you mean when you say you're using plain text passwords?
>> >>Authentication involves multiple parties handling the password in
>> >>multiple ways, and the "plain text"-ness of the password changes 
>>from
>> >>step to step.
>> >
>> >I mean that the the server authenticates the client using a NOT 
>>HASHED
>> >password. In my case using a VARCHAR field in a PostgreSQL table
>> >> >from hashlib import md5
>> >> >md5Password = md5(password).hexdigest()
>> >> >
>>
>>I'm confused here.  I don't see this code in your checker 
>>implementation
>>in the attached code.  Is this code running someplace else?
>
>No, of course you can not. This is only a little python script I use to
>produce I hashed password that I can put in the VARCHAR field of my
>PostgreSQL table. This way I can make 'pure-ftpd' authenticate using 
>md5
>hashed passwords, but for that reason I have to change pb.py code at
>twisted, swaping '.digest()' with '.hexdigest()'.
>That way it works but at the price of having to change original twisted
>code, which is not the option I want to support.

Ah, I see.  I didn't understand that you had MD5 hashed passwords stored 
in your database.

Fortunately, the .digest() and .hexdigest() outputs of an MD5 object are 
related in a simple way.  You can go from one to the other using 
str.encode('hex') or str.decode('hex').

So, if you have hex encoded MD5 digests in your database table, then you 
can convert them to the regular MD5 digests expected by PB with 
hex_digest_password.decode('hex') and pass the result of that to 
`checkMD5Password`.
>>
>>Indeed.  `checkMD5Password` needs to be passed the MD5 digest of the
>>password, not the hex encoded MD5 digest (despite being documented as
>>taking the plaintext password itself).
>
>Yes I can understand that. So if I could put ha md5 hashed password in
>the database but using digest() instead of hexdigest() I could make the
>server authenticate but using 'checkMD5Password()' method directly a 
>the
>checker, but as you have said this is going to be deprecated.

This discussion has led me to realize that checkMD5Password probably 
shouldn't be deprecated.  Instead the documentation should be fixed so 
that it's clear why it's useful.

So, assuming we don't deprecate it, and you use the decode('hex') 
approach above, does that let you do your authentication for both apps 
and let you avoid keeping a modified version of Twisted?
>> >So, how should I do it in order not to be using deprecated code? I
>> >would
>> >like to know some details so that I can have a better understanding 
>>of
>> >how authentication is working.
>>
>>If you have the plaintext password in the PB server, then you can just
>>call `checkPassword` instead of `checkMD5Password` in
>>DBCredentialsChecker._cbAuthenticate.
>
>Yes. This is working with plaintext password in the PB server, but not
>with md5 hashed passwords, right?

Right, which doesn't make sense for you, but I suggested this thinking 
that your database had plaintext passwords in it.

Jean-Paul

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Need help for structured application development

2010-02-15 Thread Einar S . Idsø
Hi,

I am planning to develop an application that will query a number of
services at given intervals, and Twisted seems like a very nice
platform to do so. However, because of little previous experience with
Twisted, especially with building proper applications, using
interfaces and using plugins, I could really need some pointers to get
me started.

In the following I will try to explain in broad terms what the
application will do, and humbly ask for input on how I may structure
it using factories, protocols etc.:

1. A number of more-or-less similar server applications (5-10) have a
number of concurrent instances/servers (1-30) each.
2. I need to acquire the status of each instance at given intervals.
These will typically range from every 20 seconds to every 3 minutes,
and depend on the which service the instance is based on.
3. A list of the server instances shall be acquired via an XML-query
every few minutes to pick up on new or removed instances.
4. An executable already exists which can be used to status-poll
almost all services using different parameters. I will be calling it
from my application to do the polling instead of recreating it in
Python.
5. I need to be able to create my own polling-protocol for at least
one of the service types which is incompatible with the executable.
6. Some services can not only be polled at intervals, but additionally
stream information that I am interested in listening to.
7. At a later point in time, I wish to be able to communicate with
IRC, MSN and other services/protocols using the queried and streamed
data.

My initial general thought is the following:
1. Design a class for each server application, where all classes
implement the same interface. The class defines how to deal with
server instances of its corresponding server application type. Classes
are created as Twisted-plugins.
2. For each new server instance that is discovered, create an object
which contains a timer and polls the server at specific intervals,
writing the result to a globally accessible data structure.
3. For server instances that stream data continuously in addition to
being polled at regular intervals, create a separate object which
listens to the server.

I believe I should somehow have a global data structure which contains
references to all the server instance objects, regardless of type, and
allows them to store data. This is sort of like the factory does for
protocols, except in my case I don't think I can use a regular factory
since I need both clients (to poll at intervals) and servers (to
listen to streaming data). I suppose I could use a ClientFactory for
the pollers and a Factory for the stream-listeners, and let them have
a common data-store? But is it possible to use a single ClientFactory
to spawn all poller-objects regardless of server type? Or do I need
one ClientFactory for each server type? Do I perhaps need one
ClientFactory per server instance? Or should I just ignore factories
all together since it is primarily the timer and asyncronicity of
Twisted I need?

I am quite certain there is a correct twistified way of handling this
sort of problem. I am just not sure what it is, and would sincerely
welcome all feedback on how this should be done. Feel free to point to
examples of applications that are similar to what I sketched above,
and tell me to study the code :)

Cheers,
Einar

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Authenticating with md5 hashed passwords

2010-02-15 Thread Ramiro Alba Queipo
Jean-Paul,

On Mon, 2010-02-15 at 16:45 +, exar...@twistedmatrix.com wrote:
> >checker, but as you have said this is going to be deprecated.
> 
> This discussion has led me to realize that checkMD5Password probably 
> shouldn't be deprecated.  Instead the documentation should be fixed so 
> that it's clear why it's useful.
> 
> So, assuming we don't deprecate it, and you use the decode('hex') 
> approach above, does that let you do your authentication for both apps 
> and let you avoid keeping a modified version of Twisted?

YES. BOTH are are working now on an unmodified twisted. Wonderful.
Jean-Paul, really grateful to you.
Now please, let me know if you are not finally deprecating
'checkMD5Password' method, or if so if I have an option to keep using
MD5 hashed passwords at the server.

Thanks again.

Regards


-- 
Ramiro Alba

Centre Tecnològic de Tranferència de Calor
http://www.cttc.upc.edu


Escola Tècnica Superior d'Enginyeries
Industrial i Aeronàutica de Terrassa
Colom 11, E-08222, Terrassa, Barcelona, Spain
Tel: (+34) 93 739 86 46


-- 
Aquest missatge ha estat analitzat per MailScanner
a la cerca de virus i d'altres continguts perillosos,
i es considera que està net.


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Authenticating with md5 hashed passwords

2010-02-15 Thread exarkun
On 06:35 pm, r...@cttc.upc.edu wrote:
>Jean-Paul,
>
>On Mon, 2010-02-15 at 16:45 +, exar...@twistedmatrix.com wrote:
>> >checker, but as you have said this is going to be deprecated.
>>
>>This discussion has led me to realize that checkMD5Password probably
>>shouldn't be deprecated.  Instead the documentation should be fixed so
>>that it's clear why it's useful.
>>
>>So, assuming we don't deprecate it, and you use the decode('hex')
>>approach above, does that let you do your authentication for both apps
>>and let you avoid keeping a modified version of Twisted?
>
>YES. BOTH are are working now on an unmodified twisted. Wonderful.
>Jean-Paul, really grateful to you.
>Now please, let me know if you are not finally deprecating
>'checkMD5Password' method, or if so if I have an option to keep using
>MD5 hashed passwords at the server.

You can follow this on http://twistedmatrix.com/trac/ticket/3056

Jean-Paul

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] XMPP server implementations with twisted/words

2010-02-15 Thread Werner Thie
Hi

Although I'mm using twisted/nevow now for more than three years it was 
only recently that I felt the need to look into the words section of 
twisted. After googling 'python xmpp server' I found two projects aiming 
at writing an xmpp server in python, namely pjabberd (non twisted) and 
pretzel.

Checking out their code via SVN shows an empty pretzel project and after 
some digging I was able to locate some code snippets, but not in an 
usable state. pjabberd checks out ok, also seems to run and is able and 
ready to accept handlers. I also found a very old post dating back to 
2005 where an effort to write a twisted XMPP server was mentioned.

http://twistedmatrix.com/pipermail/twisted-python/2005-July/011009.html

Being new in the XMPP world I ask myself and now the group, how would 
you tackle the problem of a twisted based XMPP server. Is there really 
only the Java breed of servers like OpenFire, Tigase or Erlang/Lua based 
stuff like ejabberd/Prosody available or am I simply blind.

Thanks for enlightening me, Werner



___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] XMPP server implementations with twisted/words

2010-02-15 Thread Christopher Armstrong
On Mon, Feb 15, 2010 at 6:47 PM, Werner Thie  wrote:
> Hi
>
> Although I'mm using twisted/nevow now for more than three years it was
> only recently that I felt the need to look into the words section of
> twisted. After googling 'python xmpp server' I found two projects aiming
> at writing an xmpp server in python, namely pjabberd (non twisted) and
> pretzel.
>
> Checking out their code via SVN shows an empty pretzel project and after
> some digging I was able to locate some code snippets, but not in an
> usable state. pjabberd checks out ok, also seems to run and is able and
> ready to accept handlers. I also found a very old post dating back to
> 2005 where an effort to write a twisted XMPP server was mentioned.
>
> http://twistedmatrix.com/pipermail/twisted-python/2005-July/011009.html
>
> Being new in the XMPP world I ask myself and now the group, how would
> you tackle the problem of a twisted based XMPP server. Is there really
> only the Java breed of servers like OpenFire, Tigase or Erlang/Lua based
> stuff like ejabberd/Prosody available or am I simply blind.
>
> Thanks for enlightening me, Werner

As someone who has recently started heavily using Twisted-based XMPP
technologies, I honestly don't see a big reason to have an XMPP server
written using Twisted. I don't know what kind of use cases there are
for it, but I don't think it would solve any problems for me. It seems
it's possible to do anything interesting by just using regular old
XMPP clients or External Components (all written using Twisted-based
XMPP tech such as twisted.words, Wokkel, Idavoll, or what have you).
The XMPP server is pretty much interchangeable. And I wouldn't want to
create a project to compete with ejabberd without a very good reason
:-)

-- 
Christopher Armstrong
http://radix.twistedmatrix.com/
http://planet-if.com/

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] XMPP server implementations with twisted/words

2010-02-15 Thread Alvin Delagon
Hello,

I used to write XMPP servers and clients using twisted (currently in
production) using what's available in twisted.words.xish. The docs are
scarce but you can start off reading the code and the api doc here:
http://twistedmatrix.com/documents/8.2.0/api/twisted.words.xish.htmlspecially
the domish element.


Cheers,
Alvin

On Tue, Feb 16, 2010 at 9:24 AM, Christopher Armstrong <
ra...@twistedmatrix.com> wrote:

> On Mon, Feb 15, 2010 at 6:47 PM, Werner Thie 
> wrote:
> > Hi
> >
> > Although I'mm using twisted/nevow now for more than three years it was
> > only recently that I felt the need to look into the words section of
> > twisted. After googling 'python xmpp server' I found two projects aiming
> > at writing an xmpp server in python, namely pjabberd (non twisted) and
> > pretzel.
> >
> > Checking out their code via SVN shows an empty pretzel project and after
> > some digging I was able to locate some code snippets, but not in an
> > usable state. pjabberd checks out ok, also seems to run and is able and
> > ready to accept handlers. I also found a very old post dating back to
> > 2005 where an effort to write a twisted XMPP server was mentioned.
> >
> > http://twistedmatrix.com/pipermail/twisted-python/2005-July/011009.html
> >
> > Being new in the XMPP world I ask myself and now the group, how would
> > you tackle the problem of a twisted based XMPP server. Is there really
> > only the Java breed of servers like OpenFire, Tigase or Erlang/Lua based
> > stuff like ejabberd/Prosody available or am I simply blind.
> >
> > Thanks for enlightening me, Werner
>
> As someone who has recently started heavily using Twisted-based XMPP
> technologies, I honestly don't see a big reason to have an XMPP server
> written using Twisted. I don't know what kind of use cases there are
> for it, but I don't think it would solve any problems for me. It seems
> it's possible to do anything interesting by just using regular old
> XMPP clients or External Components (all written using Twisted-based
> XMPP tech such as twisted.words, Wokkel, Idavoll, or what have you).
> The XMPP server is pretty much interchangeable. And I wouldn't want to
> create a project to compete with ejabberd without a very good reason
> :-)
>
> --
> Christopher Armstrong
> http://radix.twistedmatrix.com/
> http://planet-if.com/
>
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>



-- 
http://www.alvinatorsplayground.blogspot.com/
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] XMPP server implementations with twisted/words

2010-02-15 Thread Werner Thie
Hmm, thanks for the advice, I was leaning to the lean side of a server 
something like pjabberd seems to have taken as an approach, so to say a 
skeleton where one can hang the meat, ending up with the functionality I 
need and no more. So with t.w.xish I seem to have the bones and no 
blueprint for the skeleton and on the other side I have full fledged 
Java monsters or or other implementations which do not always get the 
best grades in stability (see the discussion of the XMPP server 
Chesspark uses, they ran into memory problems such that periodic 
rebooting was the only solution). Politically I'm wary to introduce a 
heavy piece of software for some partial functionality written in a 
completely different language now when every body has grudgingly left 
the PHP train and had to be brought a board twisted.

So again thanks, if choosing a server is no problem and poses no 
problems, then which one would you chose?

Mahalo, Werner

Alvin Delagon wrote:
> Hello,
> 
> I used to write XMPP servers and clients using twisted (currently in
> production) using what's available in twisted.words.xish. The docs are
> scarce but you can start off reading the code and the api doc here:
> http://twistedmatrix.com/documents/8.2.0/api/twisted.words.xish.htmlspecially
> the domish element.
> 
> 
> Cheers,
> Alvin
> 
> On Tue, Feb 16, 2010 at 9:24 AM, Christopher Armstrong <
> ra...@twistedmatrix.com> wrote:
> 
>> On Mon, Feb 15, 2010 at 6:47 PM, Werner Thie 
>> wrote:
>>> Hi
>>>
>>> Although I'mm using twisted/nevow now for more than three years it was
>>> only recently that I felt the need to look into the words section of
>>> twisted. After googling 'python xmpp server' I found two projects aiming
>>> at writing an xmpp server in python, namely pjabberd (non twisted) and
>>> pretzel.
>>>
>>> Checking out their code via SVN shows an empty pretzel project and after
>>> some digging I was able to locate some code snippets, but not in an
>>> usable state. pjabberd checks out ok, also seems to run and is able and
>>> ready to accept handlers. I also found a very old post dating back to
>>> 2005 where an effort to write a twisted XMPP server was mentioned.
>>>
>>> http://twistedmatrix.com/pipermail/twisted-python/2005-July/011009.html
>>>
>>> Being new in the XMPP world I ask myself and now the group, how would
>>> you tackle the problem of a twisted based XMPP server. Is there really
>>> only the Java breed of servers like OpenFire, Tigase or Erlang/Lua based
>>> stuff like ejabberd/Prosody available or am I simply blind.
>>>
>>> Thanks for enlightening me, Werner
>> As someone who has recently started heavily using Twisted-based XMPP
>> technologies, I honestly don't see a big reason to have an XMPP server
>> written using Twisted. I don't know what kind of use cases there are
>> for it, but I don't think it would solve any problems for me. It seems
>> it's possible to do anything interesting by just using regular old
>> XMPP clients or External Components (all written using Twisted-based
>> XMPP tech such as twisted.words, Wokkel, Idavoll, or what have you).
>> The XMPP server is pretty much interchangeable. And I wouldn't want to
>> create a project to compete with ejabberd without a very good reason
>> :-)
>>
>> --
>> Christopher Armstrong
>> http://radix.twistedmatrix.com/
>> http://planet-if.com/
>>
>> ___
>> Twisted-Python mailing list
>> Twisted-Python@twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>>
> 
> 
> 
> 
> 
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python