A C1000K comet/push server built with C++, for web and mobile app
C C++ JavaScript Objective-C HTML Shell Other
Latest commit 065812e Nov 28, 2016 ideawu update
Failed to load latest commit information.
demo update demo May 31, 2016
deps udpate Sep 21, 2013
docs udpate docs Jul 28, 2016
src update Nov 28, 2016
tools update tools/benchmark.cpp Sep 17, 2015
.gitignore rename comet-server -> icomet-server Oct 22, 2014
ChangeLog Reliable deliver of broadcast during reconnect May 13, 2016
LICENSE add LICENSE Feb 14, 2014
Makefile rename comet-server -> icomet-server Oct 22, 2014
README.md udpate docs Jul 28, 2016
build.sh update Nov 28, 2016
icomet.conf update icomet.conf May 14, 2016
test_icomet.conf /pub supports POST Feb 25, 2016
version update Nov 28, 2016



A C1000K comet/push server built with libevent.

iComet is powerfull, can be used as the messaging server of many applications, such as web chat, mobile application, desktop application etc.

iComet provides a easy-to-use JavaScript library, with iComet js lib, you can build a web app that needs server-push feature very fast.



iComet's role in web system and mobile system

icomet's role

The work process of iComet in your system

The work process of iComet in your system

Compile and Run


wget --no-check-certificate https://github.com/ideawu/icomet/archive/master.zip
unzip master.zip
cd icomet-master/

Start icomet server

./icomet-server icomet.conf
# or run as daemon
./icomet-server -d icomet.conf
# stop
./icomet-server icomet.conf -s stop

Make a test via curl:

curl -v ""
# open another terminal
curl -v ""

JavaScript Library Usage

var comet = new iComet({
    channel: 'abc',
    signUrl: '',
    subUrl: '',
    callback: function(content){
        // on server push

Supported Platforms and Browsers

Browser Platform
Safari iOS(iPhone, iPod, iPad), Mac
Firefox Windows, Mac
Chrome Windows, Mac
IE6, IE8 Windows

Java/Android API

Run the chat demo

  1. Compile and start icomet server
  2. Drag and drop the file demo/web/chat.html into one web browser
  3. Drag and drop the file demo/web/chat.html into another different web browser
  4. Start chatting!

Live demo

This live demo is based on https://github.com/ideawu/icomet-demos, which has buddy list, chat history, and other features.

Live Demo: http://www.ideawu.com/icomet/chat.html

Nginx + icomet

You can integrate icomet with nginx. If you are running you website on port 80 with domain www.test.com. That is you visit your website home page with this url:


Then you want to run icomet on the same server with port 80, for the concern of firewall issue. You can config nginx to pass request to icomet:

location ~ ^/icomet/.* {
    rewrite ^/icomet/(.*) /$1 break;

    proxy_read_timeout 60;
    proxy_connect_timeout 60;
    proxy_buffering off;

Then, this url is used to subscribe to icomet channel xxx:



icomet 源码分析


  • xiaozhu.com
  • testin.cn

QQ group

  • 389083972