Giter Site home page Giter Site logo

fishchatserver's Introduction

logo

FishChatServer

FishChat(鱼传 - 鱼传尺素) - FishChat是一款优秀的即时通讯软件(IM), 它集合了市面上已有产品的优点, 并具备智能硬件网关管理(学习QQ物联**, 构思中).

NOTE: 鱼传取自古乐府《饮马长城窟行》客从远方来, 遗我双鲤鱼. 呼儿烹鲤鱼, 中有尺素书.

FishChat Android客户端见 https://github.com/oikomi/FishChatAndroid (紧张开发中)

Status

It is not usable yet and still under early development.

Todo

  • support p2p communication
  • support group communication
  • support message encryption
  • support file transfer
  • support audio
  • support video

系统架构

关键服务器详解

gateway

gateway server主要是接受client请求,进行通用的功能设置,目前这块只做了分配msg_server的功能,后面可根据需要进行扩展

在gateway server的配置文件中最重要的是配置msg_server列表

"MsgServerList"      : [
		"192.168.159.169:19000",
		"192.168.159.169:19001"
	],

msg_server

msg_server是消息的主体,维护着客户端连接和keeplive,同时要注意router、manager和monitor都订阅了msg_server的channel


	SYSCTRL_CLIENT_STATUS = "/sysctrl/client-status"
	SYSCTRL_TOPIC_STATUS  = "/sysctrl/topic-status"
	SYSCTRL_TOPIC_SYNC    = "/sysctrl/topic-sync"
	SYSCTRL_SEND          = "/sysctrl/send"
	SYSCTRL_MONITOR       = "/sysctrl/monitor"

这些channel保证了msg_server在事件触发时会广播通知后面的router、manager和monitor服务

router

router顾名思义是做了msg_server之间的消息转发

manager

manager主要是管理client信息存储、离线消息存储等等,通过它和redis联系

monitor

monitor主要是收集监控各服务器状态信息,目前monitor是可选项,可按需要启动它

部署

FishChatServer采用分布式可伸缩部署方式。如果没有多机条件,可以单机部署:

建议: 单机测试部署

  • gateway一台
  • msg_server两台
  • router一台
  • manager一台
  • monitor一台

NOTE: FishChatServer依赖redis,请先启动redis,让它监听在默认端口

NOTE: 可以通过修改各文件夹下面的json配置文件配置服务器参数

./gateway

./msg_server -conf_file=msg_server.19001.json

./msg_server -conf_file=msg_server.19000.json

./router

./manager

./monitor

按上面的默认启动方式,查看系统的监听端口如下

当然你可以修改各文件夹下面的json配置文件修改配置参数

NOTE: router、manager和monitor一定要在msg_server启动之后启动,因为他们都订阅了msg_server的channel

技术细节

FishChatServer完全采用Golang开发(https://golang.org/)

音视频方案

音视频采用nginx-rtmp架构,借助ffmpeg技术,客户端输出rtmp流,服务器输出hls流

协议

1. client to MsgServer

syntax: SEND_PING_CMD

format: SEND_CLIENT_ID

--

syntax: SEND_CLIENT_ID_CMD

format: SEND_CLIENT_ID ID

--

Copyright & License

Copyright 2014 Hong Miao ([email protected]). All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

fishchatserver's People

Contributors

oikomi avatar

Watchers

 avatar 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.