All Projects → lmxdawn → Him Netty

lmxdawn / Him Netty

Licence: other
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Him Netty

Him Vue
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 142 (-26.8%)
Mutual labels:  protobuf, spring-boot, im, websocket, netty
Im
IM server based on netty. Provides a client jar. Integrate with your own login system.基于netty实现的IM服务端,提供客户端jar包,可集成自己的登录系统
Stars: ✭ 490 (+152.58%)
Mutual labels:  protobuf, spring-boot, im, netty
Netty Websocket Spring Boot Starter
🚀 lightweight high-performance WebSocket framework ( 轻量级、高性能的WebSocket框架)
Stars: ✭ 885 (+356.19%)
Mutual labels:  spring-boot, im, websocket, netty
Jetlinks Community
JetLinks 基于Java8,Spring Boot 2.x ,WebFlux,Netty,Vert.x,Reactor等开发, 是一个全响应式的企业级物联网平台。支持统一物模型管理,多种设备,多种厂家,统一管理。统一设备连接管理,多协议适配(TCP,MQTT,UDP,CoAP,HTTP等),屏蔽网络编程复杂性,灵活接入不同厂家不同协议等设备。实时数据处理,设备告警,消息通知,数据转发。地理位置,数据可视化等。能帮助你快速建立物联网相关业务系统。
Stars: ✭ 2,405 (+1139.69%)
Mutual labels:  spring-boot, websocket, netty
T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+586.08%)
Mutual labels:  im, websocket, netty
Mmorpg
springboot编写的轻量级高性能mmorpg手游服务端框架,基本功能逐渐完善中。
Stars: ✭ 309 (+59.28%)
Mutual labels:  spring-boot, websocket, netty
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+174.23%)
Mutual labels:  protobuf, websocket, netty
Mrpc
🐿 netty,zookeeper,spring,kyro rpc framework.
Stars: ✭ 128 (-34.02%)
Mutual labels:  protobuf, spring-boot, netty
Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+1006.19%)
Mutual labels:  protobuf, im, netty
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+920.1%)
Mutual labels:  protobuf, im, netty
Kingim
KingIM是基于layim的websocket即时通讯系统,底层使用netty。
Stars: ✭ 538 (+177.32%)
Mutual labels:  im, websocket, netty
Brpc Java
Java implementation for Baidu RPC, multi-protocol & high performance RPC.
Stars: ✭ 647 (+233.51%)
Mutual labels:  protobuf, spring-boot, netty
Javaquarkbbs
基于Spring Boot实现的一个简易的Java社区
Stars: ✭ 755 (+289.18%)
Mutual labels:  spring-boot, websocket, netty
Centrifuge Go
Go WebSocket client for Centrifugo and Centrifuge library
Stars: ✭ 95 (-51.03%)
Mutual labels:  protobuf, websocket
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-48.45%)
Mutual labels:  spring-boot, netty
Easyrpc
EasyRpc is a simple, high-performance, easy-to-use RPC framework based on Netty, ZooKeeper and ProtoStuff.
Stars: ✭ 79 (-59.28%)
Mutual labels:  protobuf, netty
Webfluxtemplate
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.
Stars: ✭ 107 (-44.85%)
Mutual labels:  spring-boot, websocket
Mmo Server
Distributed Java game server, including login, gateway, game demo
Stars: ✭ 114 (-41.24%)
Mutual labels:  spring-boot, netty
Almost Famous
🌟 Almost-Famous(成名之路) ——卡牌游戏开源项目,架构使用SpringBoot+Netty+Maven+SpringCloud来搭建多进程分布式框架,包括Cloud、Unique、Login、Game、Match、Battle 等服务。
Stars: ✭ 131 (-32.47%)
Mutual labels:  protobuf, netty
Gochat
goim server write by golang !🚀
Stars: ✭ 1,144 (+489.69%)
Mutual labels:  im, websocket

him-vue

him-vue him-netty QQ群

vue netty spring-boot

him-netty

使用前先阅读开源协议: 中文版 , English version , 协议出处 Anti-996-License-1.0

前端:vue 前往 ,服务端 netty 前往

踩坑指南

    1. iOS版本手机QQ中清空不了 Cookie 的bug (Android 版本的QQ没试), 其它浏览器均正常
    1. 手机微信中打开后点击输入文字后, 不管点不点击发送按钮都会出现短暂的不能点击的现象(任何按钮都不能点击), 后来发现是因为在微信里面, 输入法把 输入框顶上去了, 然后输入法隐藏后输入框还在上面!!!! 点击查看详情 。找到一个解决输入框的方法: @blur="chatTextBlur" 监听失去焦点的事件(vue 写法), 然后在事件里面执行 window.scroll(0, 0);
    1. 因为设置了定位,overflow: scroll 原生滚动,iOS下会不流畅,解决办法:换成 -webkit-overflow-scrolling: touch;

功能列表

  • [x] 单聊
  • [x] 群聊
  • [x] protobuf 编解码
  • [x] 客户端心跳
  • [x] 客户端断开重连
  • [x] 异地登录, 通知下线
  • [x] 移动端/PC端适配
  • [x] 离线消息 (消息通过 ack 机制, 实现可达性)
  • [x] 第三方QQ登录
  • [x] 自带 emoji 表情
  • [x] 文本消息
  • [ ] 声音提示
  • [ ] 图片消息
  • [ ] 音频消息
  • [ ] 视屏消息
  • [ ] 分布式部署
  • [ ] PHP 版本的 (Workerman 版本)

环境要求

git

这个版本管理肯定需要安装的

jdk

JDK 8

maven

3.6.1

spring boot

2.1.2

下载

git clone https://github.com/lmxdawn/him-netty.git

cd him-netty

SQL的导入

创建数据库,名称: him, 把 根目录下 scripts 里面的 him.sql 导入进去

打包

mvn -Dmaven.test.skip=true clean package

java -jar him-api/target/him-api-0.0.1-SNAPSHOT.jar

如果要加环境配置 --spring.profiles.active=pro 即可, 默认是 dev 环境。 特别要注意:配置文件里面有跨域配置,这个一定要注意

him-vue 前往 和 him-netty 前往 都启动后访问 http://localhost:8080

注意默认使用 QQ登录, 这个需要去申请QQ互联, 如果不想去申请, 则可以直接设置 Cookie, 两个值 UID 和 SID, 这两个值可以通过接口 /api/user/login/byPwd 获取, 具体请看java 代码

加好友演示

him-vue

加群演示

him-vue

QQ 互联相关配置

java 代码

him-api/src/main/resources/ 这里的配置文件里面, qq.auth.appidqq.auth.appkey 配置上即可

vue 代码

详细配置 根目录下的 .env.development .env.production .env.stage 这三个文件是配置, 分别代表 本地测试,生产环境,线上测试环境

名称 描述
VUE_APP_API_BASE API接口地址
VUE_APP_WEBSOCKET_URL websocket地址
VUE_APP_USER_QR_CODE_URL 生成用户的二维码地址(用来加好友的)
VUE_APP_GROUP_QR_CODE_URL 生成群二维码的地址(用来加群的)
VUE_APP_ROUTER_BASE 如果用了 NGINX 做代理, 并且有二级路径, 则需要配置此项

跨域问题

NGINX 做了端口的代理后, header 头 设置了跨域, 但是还是获取不了, 不知道为啥, 欢迎大神来指导

最后我的解决办法, 全部用一个域名, 然后 NGINX 做路径的转换,下面贴一下我的配置

# 前端路径, 注意这里配置了二级目录后, 需要 vue 的路由里面也需要配置
# 我是写在配置文件里面的 VUE_APP_ROUTER_BASE 这个配置项来控制的
location /h5 {
   try_files $uri $uri/ /h5/index.html;
}
# API 路径
location /api
{
  proxy_pass http://127.0.0.1:9000/api;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
  proxy_set_header X-Real-IP $remote_addr;
}
# ws 路径
location /ws
{
  proxy_pass http://127.0.0.1:9001;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
  proxy_set_header X-Real-IP $remote_addr;
}

protobuf 杂谈

说明: 目前所有文件都生成好了,不需要在生成,下面简单说明下

java 中使用

下载好 him-netty 后在 protocol 目录下

生成 java 类需要安装 安装 protoc 下载地址:https://github.com/protocolbuffers/protobuf/releases,

目前下载的 v3.7.1,解压到任意目录 ,然后把这个目录添加到环境变量 Path 中

然后 windows 版本执行 proto.bat 即可,Linux/Max 运行 sh proto.sh

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].