need advice: http client / async / danga socket

Martin Atkins mart at degeneration.co.uk
Fri Oct 27 23:40:55 UTC 2006


oliver oli wrote:
> hi!
> 
> i would like to make a very simple authentication plugin for djabberd 
> that's doing a http request. there are some occurrences of http requests 
> in the livejournal plugins. deducing from the comments ("LAME LAME 
> LAME"), you don't recommend usage of LWP::UserAgent inside of djabberd 
> is there any better (and still simple) solution for doing http request 
> that plays well with djabberd and asynchronous Danga::Socket?
> 

The current "solution" to this problem is to use Gearman, which is an 
out-of-process distributed job server — also a Danga thing — that can 
run asynchronously. This is how LJ Talk authenticates against LiveJournal.

This is probably an unreasonable requirement for your simple 
authentication plugin, though. A quick search on CPAN reveals 
LWP::Parallel::UserAgent, which is intended for making several parallel 
HTTP requests but also seems, based on a quick perusal, to be suitable 
for just doing one async request as well. I've not used it, but it might 
be worth taking a look at.

Perlbal (yet another Danga project) also has a basic HTTP client 
implementation based on Danga::Socket, but I'm not sure how easy it'd be 
to extract from Perlbal and re-use.



More information about the Djabberd mailing list