GithubHelp home page GithubHelp logo

c_socket.io_server's Introduction

#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 zlog from 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 zlog from 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 .

c_socket.io_server's People

Contributors

yongboy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.