• Stars
    star
    1,522
  • Rank 30,777 (Top 0.7 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created about 11 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A C1000K comet/push server built with C++, for web and mobile app

icomet

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.

Documentation

https://github.com/ideawu/icomet/wiki

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

Compile:

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

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 "http://127.0.0.1:8100/sub?cname=12&seq=1"
# open another terminal
curl -v "http://127.0.0.1:8000/push?cname=12&content=hi"

JavaScript Library Usage

var comet = new iComet({
    channel: 'abc',
    signUrl: 'http://127.0.0.1:8000/sign',
    subUrl: 'http://127.0.0.1:8100/sub',
    callback: function(content){
        // on server push
        alert(content);
    }
});

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:

http://www.test.com/

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;
	proxy_pass   http://127.0.0.1:8100;
}   

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

http://www.test.com/icomet/sub?cname=xxx

Misc

icomet 源码分析

Users

  • xiaozhu.com
  • testin.cn

QQ group

  • 389083972

More Repositories

1

ssdb

SSDB - A fast NoSQL database, an alternative to Redis
C++
8,173
star
2

Objective-C-RSA

Doing RSA encryption and decryption with Objective-C on iOS
Objective-C
1,151
star
3

c1000k

A tool to test if your OS supports 1 million connections(c1000k/c1m)
C
596
star
4

sim

Simple C++ network server framework
C++
351
star
5

cocoaui

Build adaptive UI for iOS Apps with flow-layout and CSS properties
Objective-C
325
star
6

ssdb-rocks

ssdb with rocksdb, rocksdb client-server support
C++
140
star
7

iphp

An everyone can understand PHP framework for web development
PHP
138
star
8

tftpx

TFTP server and client implementation in C
C
138
star
9

cocoaui-demos

Build Native iOS Apps with Simple HTML+CSS, Flow Layout
Objective-C
97
star
10

ssdb-docs

SSDB documentation source code
HTML
90
star
11

icomet-demos

Demos for icomet server
Java
85
star
12

ssdb-bin

SSDB pre-compiled binary
81
star
13

cpy

Cpy provides you a way to write Python codes in C syntax!
Python
62
star
14

webrtc-demo

WebRTC GIPS C/C++ API demos
C++
57
star
15

rtc

Real-Time Communication Infracture
C++
56
star
16

snappy-ios

The Snappy compression library for iOS
C++
37
star
17

CocoaUIDemo

moved to https://github.com/ideawu/cocoaui-demos
36
star
18

js-lottery

JS网页抽奖工具
HTML
14
star
19

libfast

Simple FIX and FAST protocol implementation
C++
13
star
20

tableview

JavaScript TableView, PagerView, SelectorView
HTML
12
star
21

phpvoip

SIP implement with PHP
PHP
10
star
22

ParallaxScroll

JavaScritp Parallax Scrolling, Swipe guesture
JavaScript
8
star
23

endlessssh

Tunneling SSH over HTTP
Python
8
star
24

pyhttp

Event driven HTTP library for Python
Python
6
star
25

ios_live_streaming

iOS/macOS 视频直播技术框架
Objective-C
6
star
26

manual

常用操作手册
6
star
27

iOSScrollPicker

iOS Scroll Picker
Objective-C
5
star
28

soc

Simpler Objective-C/Standard Objective-C Library
Objective-C
4
star
29

leetcode

C++
3
star
30

fifo_test

Shows how to properly read and write FIFO on Linux
C++
2
star
31

tovi-js

A JavaScript image gallery and HTML slider, with iPhone swipe effect.
CSS
1
star
32

libave

Audio Video Engine Library
C++
1
star