• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

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

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ideawu/icomet

开源软件地址(OpenSource Url):

https://github.com/ideawu/icomet

开源编程语言(OpenSource Language):

C++ 95.0%

开源软件介绍(OpenSource Introduction):

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



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
surfstudio/SurfGear: Gear for safe Surf in Flutter发布时间:2022-08-30
下一篇:
youhonglian/Vue-bilibili: Bilibili Animated mobile发布时间:2022-08-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap