APM: perl - websockets - Mojolicious ?

Montgomery Conner montgomery.conner at gmail.com
Wed Jan 2 22:23:57 PST 2013


This post (link below) gives the source code to several (claimed) working
examples of web-socket servers in Perl. It is intended to compare and
contrast building a websocket server at various levels of abstraction...
from the fairly low level (Protocol::WebSocket running in any one of a
number of Perl TCP event loops) to the high level (Mojolicious,
Plack::Middleware::WebSocket, and AnyEvent::HTTP::Server) to the
completely bare-bones (using nothing but IO::Socket::INET) .

http://showmetheco.de/articles/2010/11/timtow-to-build-a-websocket-server-in-perl.html

You may have already seen this article as it is the second link liste in a
Google search for 'perl and websockets', and I cannot vouch for any of the
code as I haven't tried it myself, but I'd be surprised if none of the 17
approaches mentioned in that article work... TIMTOWTDI strikes again.


Hope this Helps and Good Luck!
Montgomery



On Wed, Jan 2, 2013 at 8:30 PM, David Slimp <david at david-slimp.com> wrote:

> Gary,
>
> Thanks for the input.
> It's my understanding that Mojolicious is specifically built for what
> I'm trying to do with stateful / websockets stuff, as their page says this:
> "Full stack HTTP and WebSocket client/server implementation"
>
> At any rate, I'm not insisting I need to use Mojolicious, but what I
> was asking in my original email, was that I've spent several days looking
> around at the web for any types of "websockets-like" working examples
> and found a few, but I have not been able to get ANY of them to work for
> me!
>
> So, I'm asking here if anyone actually has a working example of something
> being done in perl with websockets (Mojolicious or WebSocket.pm or
> ANYTHING) ?!
>
> Do you?  Or know someone who does?
>
> thanks,
> David
>
>
> On Wed, Jan 2, 2013 at 6:14 PM, Gary Warman <warman.t.gary at gmail.com>wrote:
>
>> Aloha David!
>>
>> I can't see Mojolicious working too well with websockets, as
>> websockets send a persistent connection to whoever is connecting, and
>> mojolicious is designed for HTTP transmission, which as we all know,
>> is a stateless, one-off packet. If you had to reload the page to
>> reload a new resource, you may as well have defeated the purpose of
>> having that single stream of communication open, innit? Though,
>> systems like mojolicious are good for building the HTTP backend of the
>> website if the whole website doesn't have to be websocketed. Seems
>> like it might be a combination of Mojolicious and
>>
>> http://search.cpan.org/~vti/Protocol-WebSocket-0.12/lib/Protocol/WebSocket.pm
>>
>>
>> On 12/2/12, David Slimp <david at david-slimp.com> wrote:
>> > Hey folks!
>> >
>> > I've got a project that the new HTML 5 websockets would be perfect for!
>> >
>> > I've spent the last 2 days looking around the web and I think
>> Mojolicious
>> > is probably the Perl module I want.  There are a few pages with samples,
>> > but none really seem to work (for me) !
>> >
>> > Is anyone on this list doing something with Perl and websockets?
>> >
>> > Does anyone have an example that actually works?
>> >
>> > thanks!
>> > David
>> >
>>
>>
>> --
>> Thank you,
>> Gary Warman
>>
>> LinkedIn <http://www.linkedin.com/in/garywarman>
>>
>
>
> _______________________________________________
> Austin mailing list
> Austin at pm.org
> http://mail.pm.org/mailman/listinfo/austin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/austin/attachments/20130102/22301216/attachment-0001.html>


More information about the Austin mailing list