Git Product home page Git Product logo

withme's Introduction

WithMe 1.0 Alpha

  这个项目是使用JavaEE开发的一个多人在线即时聊天系统。

新版本开发

因为这个版本是我几年前开发的,所以目前不做维护和更新。目前我正在使用微服务开发的模式,使用Netty作为websocket服务器,使用redis作为缓存等方式以提高聊天系统的可扩展性,并发性等各方面性能,同时也开发新的功能。欢迎大家关注以及共同开发~
WithMe3.0目前功能已经正常,并且我在进行持续开发和维护,欢迎使用WithMe3.0.
项目地址: https://github.com/IcedSoul/WithMe3.0

运行说明

 请按照以下方式来让此项目在你的电脑上运行。

1. 使用git命令行执行以下命令将项目下载到本地(需安装Git客户端)

 https://github.com/IcedSoul/WithMe
 
2. 打开WithMe/WithMe 2.0 Alpha/JavaEE(Server&Client)/WithMe,这个目录为项目的根目录(后面说的根目录都是指的这个目录)。当前目录下src/main/resources/withme.sql为建表语句。确认自己本地MySQL已经安装并且正常运行,使用navicat或者命令行在MySQL使用WithMe.sql里面语句新建对应数据库和表。

3. 修改项目根目录下src/main/resources/properties下面database.properties文件,将数据库连接地址,用户名和用户密码修改为自己使用的MySQL数据库。

4. 在命令行下进入项目根目录,执行一下命令(需要先安装Maven工具并且配置好环境变量,如未安装可以百度&Google安装方式。)

mvn clean package -DskipTests

5. 执行成功后即可在根目录下target文件夹下看到WithMe.war文件,将这个文件复制到Tomcat安装(也就是解压)目录下的webapps文件夹内,然后重启tomcat即可。(需下载并且解压Tomcat,版本最好为8.0或以上)

6. 在浏览器访问http://localhost:8080/WithMe来查看效果。

7. 测试请使用两个浏览器注册并且登录两个账号,搜索彼此添加好友来进行聊天。

运行截图

聊天

主要功能

  1.注册/登录
  2.搜索用户,查看用户信息,发送好友申请,同意好友申请
  3.单人即时聊天
  4.建立群组,邀请好友入群,查看群组成员
  5.群组聊天

采用框架及协议

  使用JavaEE框架:Spring+SpringMVC+Hibernate
  前端:Bootstrap+Layer.js插件
  通信:使用JavaEE 7.0 WebSocket协议
此处请注意:WithMe1.0 Alpha 版本所使用的 WebSocket 为 JavaEE7.0(及以上)自带的 javax.websocket 类库,WebSocket版本为JSR356,无法实现与 Android 端以及桌面端通信的功能。

说明

 因为使用的WebSocket协议只支持Web端,本项目只有web端。但是,我们会基于 WithMe 1.0 Alpha 继续开发 WithMe 2.0 Alpha 版本,在在2.0中,我们将采用新的WebSocket协议,实现web端、Android端以及桌面端的互相通信。


WithMe 2.0 Alpha

  WithMe2.0优化了WithMe1.0仅支持Web端的问题,采用了新版本的Java-WebSocket,实现了与Android端和Java桌面端的即时通信。

主要功能

  功能同WithMe1.0,添加了Android端单聊和群聊功能。

采用框架及协议

  框架和协议与WithMe1.0相同。
  WebScoket由JavaEE7.0的javax.websocket变为Java-Websocket。

withme's People

Contributors

dependabot[bot] avatar icedsoul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

withme's Issues

你好,现在你的实时聊天数据是怎么存储的

我做了一个web即时聊天的demo,然后就在想发送的聊天数据怎么存储下来更好
我考虑过用MySQL做,但是假设人很多的话,数据库会吃不消我觉得,
所以我想了解一下有没有什么更好的方式来存储聊天数据,
我现在想到的选择就是用Redis或者MongonDB
麻烦了

聊天消息存在 XSS / 接口未鉴权,导致可以随意遍历用户好友

大佬你好,偶然间在百度上搜到了你的这个聊天室,做的很棒!

我尝试着体验了一下,发现了一些问题:

聊天消息存在 XSS

用户发送的聊天信息未做 XSS 过滤,导致可以任意执行 JavaScript 代码。

发送者发送:

<script>alert(1);</script>

接受者 Web 端可以出现弹窗:

同样,在创建群填写信息那里,也是可以 XSS 注入的。

查询好友的接口未鉴权

通过给http://119.23.212.211:8080/WithMe/getRelations发送POST请求来获取用户的好友。
这里需要传入当前用户的 ID,即userId
这里可以修改userId发送请求从而任意遍历用户的好友。
其中因为 ID 为 0 的管理员账户会默认添加所有用户为好友,因此管理员的好友就包含聊天室所有的账户信息。

同样,获取用户所加入群的接口http://119.23.212.211:8080/WithMe/getUserGroups也是没有鉴权的,导致可以随意查看。

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.