The socket.io Linux C server
C JavaScript Other
Switch branches/tags
Nothing to show
Latest commit 5c3201f May 13, 2013 @yongboy yongboy Merge pull request #1 from bliker/master
Random newline bugfix
Permalink
Failed to load latest commit information.
example Printf -> log_debug,log_info,log_warn Mar 22, 2013
include Delete some code Mar 14, 2013
log Just for save logs Mar 22, 2013
static Index.html Mar 22, 2013
.gitignore Add *.log Mar 26, 2013
Makefile Add -lzlog and log.c Mar 22, 2013
README.md Fix for wired line break bug May 12, 2013
client_session.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
endpoint.h Define two functions:send_msg and broadcast_clients Mar 15, 2013
endpoint_impl.h Add log.h header file Mar 22, 2013
endpoints.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
flashsocket.c initial commit Mar 5, 2013
handle_static.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
htmlfile.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
jsonp-polling.c Fix the body_len bug Mar 14, 2013
log.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
log.conf Printf -> log_debug,log_info,log_warn Mar 22, 2013
log.h Printf -> log_debug,log_info,log_warn Mar 22, 2013
need.todo Delete some code Mar 14, 2013
parseurl.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
safe_mem.h Add glib.h head file Mar 22, 2013
server.ini Modify heartbeat_interval = 25 Mar 22, 2013
socket.io_base.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
socket.io_handle_post.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
socket.io_handle_request.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
socket.io_server.h initial commit Mar 5, 2013
socket_io.c Printf -> log_debug,log_info,log_warn Mar 22, 2013
socket_io.h Add #include "log.h" Mar 26, 2013
store.c Check the key & format code Mar 14, 2013
store.h Remove unuseless code Mar 22, 2013
transport.h Do nothing Mar 26, 2013
transports.c initial commit Mar 5, 2013
transports.h initial commit Mar 5, 2013
websocket.c Remove line printf("websocket write ori msg is %s\n", ori_msg); Mar 15, 2013
xhr-polling.c Printf -> log_debug,log_info,log_warn Mar 22, 2013

README.md

#The C socket.io server

##NOTES The socket.io Linux C server, now just in developing at moment.
The server base on libev and glib, and run in linux systems now.
Before run the socket.io server, you have to install some dependencies before:

sudo apt-get install uuid-dev
sudo apt-get install libglib2.0-dev
git clone https://github.com/HardySimpson/zlog then make & make install it

The socket.io server may contains some hidden bugs, if you find it, please notice me :))

##How to use

  1. write you implemetion, eg:chatroom.c
  2. put your implemetion code(chatroom.c) in the example folder
  3. create your static html files put them into static folder
  4. edit the Makefile file
  5. open the console, type #make
  6. type ./socket.io_server
  7. access your webpages in browser now, eg: http://localhost:8000/chatroom.html
  8. enjoy it~

##The API NOTES You have include the head file endpoint_impl.h within your code,which extends endpoint.h, the whole interface define, you can find here.
There are two demos in example folder, chatroom and whiteboard examples.


##说明 这是一个纯C语言版本的socket.io服务器端实现,目前仅支持linux系统,严重依赖libev and glib等基础库。
在运行socket.io_server之前,需要安装以下依赖:

sudo apt-get install uuid-dev
sudo apt-get install libglib2.0-dev
git clone https://github.com/HardySimpson/zlog then make & make install it

##如何运行

  1. 编写实现代码(eg:chatroom.c),需要包含头文件 endpoint_impl.h
  2. 把实现代码(eg:chatroom.c)放入examples目录
  3. 编写对应的html文件,放入static目录
  4. 编辑Makefile文件
  5. 终端下运行make命令
  6. 然后敲入 ./socket.io_server 接口运行
  7. 打开浏览器即可访问 (eg:http://localhost:8000/chatroom.html)

##API说明 对外的API,可以在头文件 endpoint_impl.h 看到其定义,其继承了另外一个公用的头文件 endpoint.h, 完整的面向实现代码的头文件定义见 完整定义.
在example目录中,你可以看到聊天室演示 chatroom 和在线白板示范 whiteboard .