Coder Social home page Coder Social logo

webim's Introduction

Web IM

主要功能

  1. 群聊
  2. 单聊
  3. 登录登出
  4. 广播 (用户想全部在线用户推送消息)
  5. 单播 (可用于向app推送消息)

Image text

Usage

cd webim/comet

bee run

聊天室和相关接口  http://127.0.0.1:8080 

beego进程监控 http://127.0.0.1:8088/

API 接口说明

 / 聊天室欢迎页(登录页)
 /webim  聊天室主页
 /room/create  //创建聊天室接口
 /room/delete  //删除聊天室接口
 /ws           //websoket长链接

/push/unicast //单播推送接口

method post
body
    {
		"device_token":"580ddd1f50f561a0968fa5fcd0cdad05",
		"msg":{
			"type":0,
			"data":"{\"content\":\"单播消息\"}"
		}
	}

/push/broadcast //广播推送接口

method post
body
   {
   	"msg":{
   		"type":10,
   		"data":"{\"content\":\"广播消息\"}"
   	}
   }

/monitor/status //系统监控接口

/user/register //用户注册

附录

消息类型

const (
	TYPE_COMMON_MSG  = float64(0)   //单个用户消息
	TYPE_ROOM_MSG    = float64(1)   //聊天室消息 到聊天室所有的人
	TYPE_JOIN_ROOM   = float64(2)   //进入房间
	TYPE_LEAVE_ROOM  = float64(3)   //退出房间
	TYPE_CREATE_ROOM = float64(4)   //创建房间
	TYPE_LOGIN       = float64(5)   //登录
	TYPE_LOGOUT      = float64(6)   //退出
	TYPE_NOTICE_MSG  = float64(10)  //通知类消息广播
	TYPE_REGISTER    = float64(11)  //注册设备生成deviceToken
	TYPE_TRANSPOND   = float64(12)  //将消息转发到其他系统微服务,并将其他系统获取的结果返回给客户端
	TYPE_PING        = float64(99)  //PING
	TYPE_PONG        = float64(100) //PONG
)

webim's People

Watchers

James Cloos 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.