[DFW.pm] CGI Web Socket

Jerry Kassebaum kassebaumj at hotmail.com
Tue Apr 16 05:16:13 PDT 2013


Hi Stuart.

Did you get the web socket to actually work for you? I'd like the url to see it in action.

Let me know if you want to come by for a homebrew!

Jerry

> Date: Sat, 13 Apr 2013 19:18:51 -0500
> From: saj at thecommune.net
> To: dfw-pm at pm.org
> Subject: Re: [DFW.pm] CGI Web Socket
> 
> A few notes:
> 
> I don't know why but the Standalone Plack backend does not work. Install 
> Twiggy.  This should do it:
> 
> cpanm PocketIO Plack::App::File Plack::Builder Plack::Middleware::Static 
> Plack::Handler::Twiggy
> 
> 'plackup chat.psgi' starts up the server and will give you a local 
> address like: http://0.0.0.0:5000/
> 
> This works but the chat.html file will be cached when you connect this 
> way.  If you want to play around with the frontend use 
> http://0.0.0.0:5000/chat.html and you won't have to restart the server 
> every time you change the html.
> 
> Now I just need to find an excuse to use this at $work!
> 
> 
> 
> On 04/13/2013 06:20 PM, Stuart A Johnston wrote:
> > PDXPM did a talk on this topic on Thursday.  What I gather is that you
> > need a frontend library and a compatible backend.  Socket.IO and SockJS
> > seem to be the most popular frontends.  Both have Perl modules for the
> > backend, written by the same guy and based on Plack.
> >
> > PocketIO has a more interesting example and a longer history so I'm
> > going to give that a try.
> >
> > https://metacpan.org/module/PocketIO
> > https://metacpan.org/source/VTI/PocketIO-0.15/examples/chat
> >
> >
> > On 04/13/2013 04:13 PM, Jerry Kassebaum wrote:
> >> Could someone please give me  an HTML/JavaScript file and a Perl/CGI
> >> file to get me started with web sockets?
> >>
> >> I'd suggest something like this. A Firefox tab and a Google Chrome tab
> >> each are open to the same HTML/JavaScript site. The site has three
> >> buttons. When I press any button in either browser it changes color PLUS
> >> sends a message to my server which in turn sends a message through the
> >> web socket so that the corresponding button in the other browser also
> >> changes color.
> >>
> >> Thanks in advance! I'm willing to bribe with homebrew (mine) or homemade
> >> wine (my wife's) if that will help.
> >>
> >> Jerry Kassebaum
> >>
> >>
> >> _______________________________________________
> >> Dfw-pm mailing list
> >> Dfw-pm at pm.org
> >> http://mail.pm.org/mailman/listinfo/dfw-pm
> >>
> >
> > _______________________________________________
> > Dfw-pm mailing list
> > Dfw-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/dfw-pm
> 
> _______________________________________________
> Dfw-pm mailing list
> Dfw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/dfw-pm
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/dfw-pm/attachments/20130416/b9e88fca/attachment.html>


More information about the Dfw-pm mailing list