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