Project

cockatoo

0.02
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Cockatoo is a simple chat server coded with EventMachine and using the Long Polling technique
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.0
>= 0.12.10
>= 4.2.1
>= 1.1.8
>= 0.7.0
 Project Readme

Cockatoo¶ ↑

Cockatoo is a simple chat server. It’s coded in Ruby with the help of the fantastic EventMachine.

There are several techniques to handle the real-time web, but we decided to use the Long Polling technique. It works with plenty of browsers.

If you don’t know EventMachine and Long Polling, maybe you can read “Long Polling with Event Machine”.

Server part¶ ↑

The server part is coded in Ruby and EventMachine. The protocol is pretty straightforward.

Client part¶ ↑

You can use any client part you want. We provide 4 components so you can setup a simple chat system in any Ruby/Rails app you’re working on :

Just include the 2 templates and the javascript lib in your layout and you’ll be good to go.

Here are two screenshots of the client side in action :

Installation¶ ↑

gem install cockatoo

Usage¶ ↑

Beware that you’ll need a “log” directory located where you will run cockatoo.

start the server (by default it will run on the 8000 port)

cockatoo start

start the server on the 9000 port

cockatoo start -- 9000

stop the server

cockatoo stop

restart the server

cockatoo restart

You will need an HTTP server in front of your Ruby/Rails app and your chat server.

In Nginx, you will have to add something like the following to your configuration file :

server {
  listen 80;
  server_name mywebapp.com;
  root /home/rails/www/lollidays/current/public;
  passenger_enabled on;

  location /chat {
    proxy_pass        http://mychatserver:8000;
    proxy_set_header  X-Real-IP  $remote_addr;
  }
}

And in Apache :

ProxyPass          /chat http://mychatserver:8000
ProxyPassReverse   /chat http://mychatserver:8000
ProxyPreserveHost  On

Copyright © 2010 Novelys. See LICENSE for details.

Contributors¶ ↑