All Projects → yuanrw → Im

yuanrw / Im

IM server based on netty. Provides a client jar. Integrate with your own login system.基于netty实现的IM服务端,提供客户端jar包,可集成自己的登录系统

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Im

Him Vue
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 142 (-71.02%)
Mutual labels:  protobuf, spring-boot, im, netty
Him Netty
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 194 (-60.41%)
Mutual labels:  protobuf, spring-boot, im, netty
Javaquarkbbs
基于Spring Boot实现的一个简易的Java社区
Stars: ✭ 755 (+54.08%)
Mutual labels:  spring-boot, spring, netty
Brpc Java
Java implementation for Baidu RPC, multi-protocol & high performance RPC.
Stars: ✭ 647 (+32.04%)
Mutual labels:  protobuf, spring-boot, netty
Mrpc
🐿 netty,zookeeper,spring,kyro rpc framework.
Stars: ✭ 128 (-73.88%)
Mutual labels:  protobuf, spring-boot, netty
Netty Websocket Spring Boot Starter
🚀 lightweight high-performance WebSocket framework ( 轻量级、高性能的WebSocket框架)
Stars: ✭ 885 (+80.61%)
Mutual labels:  spring-boot, im, netty
Books Recommendation
程序员进阶书籍(视频),持续更新(Programmer Books)
Stars: ✭ 558 (+13.88%)
Mutual labels:  spring-boot, spring, netty
Fpush
📶即时消息推送服务(即时通讯),基于Netty+protobuf-- Instant Messaging push service based on Netty+protobuf
Stars: ✭ 134 (-72.65%)
Mutual labels:  im, instant-messaging, netty
bootpush
📶即时消息推送服务(即时通讯),基于Netty- Instant Messaging push service based on Netty
Stars: ✭ 146 (-70.2%)
Mutual labels:  netty, instant-messaging, im
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+303.88%)
Mutual labels:  protobuf, im, netty
Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+337.96%)
Mutual labels:  protobuf, im, netty
Spring Boot Demo
spring boot demo 是一个Spring Boot、Spring Cloud的项目示例,根据市场主流的后端技术,共集成了30+个demo,未来将持续更新。该项目包含helloworld(快速入门)、web(ssh项目快速搭建)、aop(切面编程)、data-redis(redis缓存)、quartz(集群任务实现)、shiro(权限管理)、oauth2(四种认证模式)、shign(接口参数防篡改重放)、encoder(用户密码设计)、actuator(服务监控)、cloud-config(配置中心)、cloud-gateway(服务网关)等模块
Stars: ✭ 323 (-34.08%)
Mutual labels:  spring-boot, spring, netty
Mmorpg
springboot编写的轻量级高性能mmorpg手游服务端框架,基本功能逐渐完善中。
Stars: ✭ 309 (-36.94%)
Mutual labels:  spring-boot, spring, netty
Im
仿QQ即时通讯系统服务端
Stars: ✭ 369 (-24.69%)
Mutual labels:  spring, im, netty
All Things Cqrs
Comprehensive guide to a couple of possible ways of synchronizing two states with Spring tools. Synchronization is shown by separating command and queries in a simple CQRS application.
Stars: ✭ 474 (-3.27%)
Mutual labels:  spring-boot, spring
Watchdog Framework
🍻 「停止维护」基于SpringBoot+Shiro+Mybatis等开发的轻量级管理系统快速开发脚手架
Stars: ✭ 421 (-14.08%)
Mutual labels:  spring-boot, spring
Framework Learning
计算机学习资料(Java , Jvm , Linux , Mysql , Netty , Redis , Netty , Spring , SpringBoot , Mybatis , Rabbitmq ,计算机网络 , 数据结构与算法 , 设计模式 )Github网页阅读:https://guang19.github.io/framework-learning , Gitee网页版阅读: https://qsjzwithguang19forever.gitee.io/framework-learning
Stars: ✭ 416 (-15.1%)
Mutual labels:  spring, netty
Spring boot
Spring Boot 使用总结 和 demo。 如果您觉得本代码对您有所帮助,请点击页面右上方"Star"
Stars: ✭ 431 (-12.04%)
Mutual labels:  protobuf, spring-boot
Tutorial
Java全栈知识架构体系总结
Stars: ✭ 407 (-16.94%)
Mutual labels:  spring, netty
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (-12.65%)
Mutual labels:  spring-boot, netty

IM

Build Status codecov codebeat badge release last commit

IM is a lightweight instant messaging server. It also provides a client jar,allows you to develop your own client.For example,with spring boot. It's able to login with your own login system or with ldap.

中文

Features

  • One to one text/file message
  • Sent/Delivered/Read message
  • Ldap Authentication
  • Authenticate with individual login system
  • Horizontal expansion
  • Provide client jar

Quick Start

Prepare

We use docker to quick start IM.

# detect if the docker environment is avaliable.
docker -v
# clone the repository
git clone [email protected]:yuanrw/IM.git

Start

cd IM/docker
docker-compose up

There is a simple sample in the container,it starts serveral clients and send messages to their friends randomly,printing logs which are similar with followed:

......
2019-08-11 17:29:13.451 client-samples - [Olive] get a msg: 357980857883037697 has been read
2019-08-11 17:29:13.452 client-samples - [yuanrw] get a msg: 357980857887232002 has been read
2019-08-11 17:29:13.452 client-samples - [xianyy] get a msg: 357980857887232001 has been read
2019-08-11 17:29:13.452 client-samples - [Adela] get a msg: 357980857874649089 has been read
2019-08-11 17:29:13.452 client-samples - [Bella] get a msg: 357980857874649090 has been read
2019-08-11 17:29:13.452 client-samples - [Tom] get a msg: 357980857887232000 has been read



sentMsg: 51, readMsg: 51, hasSentAck: 51, hasDeliveredAck: 51, hasReadAck: 51, hasException: 0



2019-08-11 17:29:15.114 client-samples - [Bella]get a msg: 357980866275840002 has been sent
2019-08-11 17:29:15.114 client-samples - [Adela]get a msg: 357980866275840000 has been sent
2019-08-11 17:29:15.114 client-samples - [Cynthia]get a msg: 357980866275840003 has been sent
......

Distributed Deploy

mvn clean package -DskipTests

get $SERVICE_NAME-$VERSION-bin.zip under dir /target

Environment Requirement

  • java 8+
  • mysql 5.7+
  • rabbitmq
  • redis

Start

Start services with the following order: rest-web --> transfer -->connector

Here are the steps for start rest-web,transfer and connector are similar with it.

rest-web

  1. Unzip
unzip rest-web-$VERSION-bin.zip
cd rest-web-$VERSION
  1. Update the config file
server.port=8082

# your log path
log.path=

# your jdbc config
spring.datasource.url=
......

# your redis config
spring.redis.host=
......

# your rabbitmq config
spring.rabbitmq.host=
......
  1. run the sql in the file rest.sql

  2. start server

java -jar rest-web-$VERSION.jar --spring.config.location=application.properties

transfer

java -jar -Dconfig=transfer.properties transfer-$VERSION.jar

connector

java -jar -Dconfig=connector.properties connector-$VERSION.jar

Nginx Config

All services are available to expand horizontally,connections need to be kept alive between each client and connector server. A sample nginx config:

stream {
	upstream backend {
        # connector services port
        server 127.0.0.1:9081         max_fails=3 fail_timeout=30s;
        server 127.0.0.1:19081			max_fails=3 fail_timeout=30s;
	}

    server {
        # to keep a persistent connection
        listen 9999 so_keepalive=on;
        proxy_timeout 1d;
        proxy_pass backend;
    }
}

Login

There is a simple usable login system in IM. IM also support the following two ways to authenticate.

ldap

We use open ldap as an example. update application.properties

spi.user.impl.class=com.yrw.im.rest.web.spi.impl.LdapUserSpiImpl

# the following config should be replace with your own config
spring.ldap.base=dc=example,dc=org
# admin
spring.ldap.username=cn=admin,dc=example,dc=org
spring.ldap.password=admin
spring.ldap.urls=ldap://127.0.0.1:389
# user filter,use the filter to search user when login in
spring.ldap.searchFilter=
# search base eg. ou=dev
ldap.searchBase=
# user objectClass
ldap.mapping.objectClass=inetOrgPerson
ldap.mapping.loginId=uid
ldap.mapping.userDisplayName=gecos
ldap.mapping.email=mail
java -jar rest-web-$VERSION.jar --spring.config.location=application.properties

individual login system

  1. Implement the spi in com.yrw.im.rest.spi.UserSpi
public interface UserSpi<T extends UserBase> {

    /**
     * get user by username and password, return user(id can not be null)
     * if username and password are right, else return null.
     * <p>
     * be sure that your password has been properly encrypted
     *
     * @param username
     * @param pwd
     * @return
     */
    T getUser(String username, String pwd);

    /**
     * get user by id, if id not exist then return null.
     *
     * @param id
     * @return
     */
    T getById(String id);
}
  1. Update application.properties
# your implement class full name
spi.user.impl.class=
  1. Build
mvn clean package -DskipTests

Use client jar

A client demo:

MyClient.java

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