2 Chatty -- Real-time (comet) chat application written with Perl/Catalyst
5 cpan Catalyst::Devel # install Catalyst
8 make installdeps # install other dependencies
10 cp extra/nginx.conf /etc/nginx/nginx.conf
11 /etc/rc.d/nginx start # run nginx http server
13 cp extra/cometd/meteord.conf.dist /etc/meteord.conf
14 # also add the 'SubscriberDocumentRoot' option to meteord.conf;
15 # it should be set to $REPOSITORY_ROOT/extra/cometd/public_html
17 cd extra/cometd; ./meteord -d # run meteord in a new shell
19 cat extra/hosts >>/etc/hosts # configure hostnames
20 sqlite3 db/info.db <db/schema.sql # create the user database
22 ./script/chatty_server.pl -f # run the app
23 firefox http://chatty.com/ # finally, see if it works
26 This is a toy web application implementing real-time (comet) chat. I
27 wrote this as an exercise to see how easy it would be to write such an
28 application using Perl/Catalyst. It was fairly easy.
30 Catalyst itself provides no streaming support or message bus, so I am
31 using a dedicated comet server to handle all of that, meteord. However,
32 in order to get meteord to work, it needs to be serving on the same port
33 as the Catalyst app. I accomplished this by using nginx as a reverse
34 proxy. However, you can't just use localhost because meteord does some
35 checks on the hostname to make sure it will not run into any
36 cross-domain restrictions, and those checks barf if the hostname doesn't
37 have a TLD. The fix for this is to just assign some fake hostnames to
38 localhost; the provided nginx configuration uses chatty.com for the
39 Catalyst app and data.chatty.com for the comet server, both on port
40 number 80. The actual Catalyst app runs on port 3000 and meteord runs on
41 port 4670. That's the reason for the complicated setup.
43 The perl dependencies can all be installed locally in a subdirectory of
44 the user's home directory using local::lib, like this:
46 # install local::lib (see L<http://search.cpan.org/dist/local-lib/>)
48 eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
50 It is also usually much nicer to work with cpanminus rather than plain
54 curl -L http://cpanmin.us | perl - --self-upgrade
57 Tests are sadly nonexistent. :-(
60 Charles McGarvey <chazmcgarvey at brokenzipper.com>
63 This library is free software. You can redistribute it and/or modify it
64 under the same terms as Perl itself.