[Catalyst] Catalyst with Twiggy with Pocket.IO (Comet)

Jaroslav Zajonc jaro.zajonc at gmail.com
Wed Nov 28 20:03:28 GMT 2012


Hi all,

Thanks a lot for all your suggestions. Yu helped me a lot.

thnx,
Jaro

On Nov 28, 2012, at 4:38 PM, Tim Anderson <tja824 at gmail.com> wrote:

> I also faced this problem, and what I did to resolve it was move the auth=
entication piece out to Apache (from my Catalyst application), and then use=
d the Catalyst::Authentication::Credential::Remote module to 'use' what Apa=
che is doing for me.  Once the auth config is in Apache, you can use it to =
authenticate other applications as well (in my case it was a series of Tomc=
at servlets).  I'm really pleased with the solution.
> =

> =

> -Tim
> =

> =

> On Wed, Nov 28, 2012 at 9:04 AM, Gabriel Andrade <gabiruh at gmail.com> wrot=
e:
> =

> On Nov 28, 2012, at 9:21 AM, Jaro Zajonc <jaro.zajonc at gmail.com> wrote:
> =

> > But if I direct traffic from Apache directly to Twiggy server I'd bypas=
s Catalyst Authentication/Authorization part for Comet session, right?
> > I'd like to allow only authenticated users to subscribe to comet channe=
l.
> > I am sure I am missing some really simple piece of the puzzle :-\
> =

> =

> I've been through the same dilemma. Solved it by sharing appropriate
> data between Plack and Catalyst using Catalyst::TraitFor::Request::Plack:=
:Session.
> It's clumsy and I haven't thoroughly tested it, though=85 So, there might=
 be (serious)
> limitations.
> =

> Here's how it goes=85  something along these lines:
> =

> builder {
>   enable 'Session',
>     store =3D>
>     Plack::Session::Store::Cache->new( cache =3D> CHI->new( driver =3D> (=
=85) ) );
> =

>   mount '/' =3D> $catalyst_psgi_app;    # auth, etc..
>                                       # (you're logging in first, aren't =
you?)
> =

>   # when you reach here, auth is already made
>   # and Plack::Session is stuffed
> =

>   mount '/socket.io' =3D> PocketIO->new(
>     handler =3D> sub {
>       $_[1]->{'psgix.session'}->{can_foo};
>     }
>   );
> };
> =

> =85 and then
> =

> > plackup -s AnyEvent::FCGI myapp.psgi
> =

> Also, here, a message queue suits it well for sharing data and
> messaging passing, given you've already pointed the proper queue key
> in session.
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/
> =

> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.u=
k/
> Dev site: http://dev.catalyst.perl.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20121128/2d3d3=
b2c/attachment.htm


More information about the Catalyst mailing list