]> Dogcows Code - chaz/chatty/blob - README
validate sent chat to avoid spurious join messages
[chaz/chatty] / README
1 NAME
2 Chatty -- Real-time (comet) chat application using Catalyst
3
4 SYNOPSIS
5 # install perl dependencies; skip to the next set of instructions
6 # while the dependencies are installing
7 cpan Catalyst::Devel
8 perl Makefile.PL
9 make installdeps
10
11 # install nginx (or install and configure some other reverse proxy)
12 # configure nginx and run it
13 sudo cp extra/nginx.conf /etc/nginx/nginx.conf
14 sudo /etc/rc.d/nginx start
15
16 # configure the comet server (see L<http://meteorserver.org/>)
17 sudo cp extra/cometd/meteord.conf.dist /etc/meteord.conf
18 # add the 'SubscriberDocumentRoot' option to meteord.conf;
19 # it should be set to $REPOSITORY_ROOT/extra/cometd/public_html
20 # run meteord (in another terminal)
21 ./extra/cometd/meteord -d
22
23 # configure hostnames
24 sudo cat extra/hosts >>/etc/hosts
25
26 # create the user database
27 sqlite3 db/info.db <db/schema.sql
28
29 # finally, run the application and try it out
30 ./script/chatty_server.pl -f
31 firefox http://chatty.com/
32
33 DESCRIPTION
34 This is a toy web application implementing real-time (comet) chat. I
35 wrote this as an exercise to see how easy it would be to write such an
36 application using Perl/Catalyst. It was fairly easy.
37
38 Catalyst itself provides no streaming support or message bus, so I am
39 using a dedicated comet server to handle all of that, meteord. However,
40 in order to get meteord to work, it needs to be serving on the same port
41 as the Catalyst app. I accomplished this by using nginx as a reverse
42 proxy. However, you can't just use localhost because meteord does some
43 checks on the hostname to make sure it will not run into any
44 cross-domain restrictions, and those checks barf if the hostname doesn't
45 have a TLD. The fix for this is to just assign some fake hostnames to
46 localhost; the provided nginx configuration uses chatty.com for the
47 Catalyst app and data.chatty.com for the comet server, both on port
48 number 80. The actual Catalyst app runs on port 3000 and meteord runs on
49 port 4670. That's the reason for the complicated setup.
50
51 The perl dependencies can all be installed locally in a subdirectory of
52 the user's home directory using local::lib, like this:
53
54 # install local::lib (see L<http://search.cpan.org/dist/local-lib/>)
55 # then,
56 eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
57
58 It is also usually much nicer to work with cpanminus rather than plain
59 old cpan:
60
61 # install cpanminus
62 curl -L http://cpanmin.us | perl - --self-upgrade
63
64 BUGS
65 Tests are sadly nonexistent. :-(
66
67 AUTHOR
68 Charles McGarvey <chazmcgarvey at brokenzipper.com>
69
70 LICENSE
71 This library is free software. You can redistribute it and/or modify it
72 under the same terms as Perl itself.
73
This page took 0.031503 seconds and 4 git commands to generate.