All Projects → laubrence → Minchat

laubrence / Minchat

基于tomcat 7. 0.56 websocket的在线客服系统

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Minchat

Huobi
火币的行情交易的python实现
Stars: ✭ 129 (-11.64%)
Mutual labels:  websockets
Bolt Js
A framework to build Slack apps using JavaScript
Stars: ✭ 1,971 (+1250%)
Mutual labels:  websockets
React Native Signalr
Use SignalR with React Native
Stars: ✭ 141 (-3.42%)
Mutual labels:  websockets
Fs2 Http
Http Server and client using fs2
Stars: ✭ 132 (-9.59%)
Mutual labels:  websockets
Hprose Js
Hprose is a cross-language RPC. This project is Hprose 2.0 RPC for JavaScript
Stars: ✭ 133 (-8.9%)
Mutual labels:  websockets
Osc Js
OSC library for Node.js, Electron, Chrome Apps, Webpages or any other JS application. It comes with a customizable Plugin API for WebSocket, UDP or bridge networking
Stars: ✭ 135 (-7.53%)
Mutual labels:  websockets
Websocket Nats
An in-browser websocket client for NATS, a lightweight, high-performance cloud native messaging system
Stars: ✭ 125 (-14.38%)
Mutual labels:  websockets
Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (-1.37%)
Mutual labels:  websockets
Tacks
Real-time multiplayer sailing game, in your browser
Stars: ✭ 134 (-8.22%)
Mutual labels:  websockets
Graphqlws
Implementation of the GraphQL over WebSocket protocol in Go.
Stars: ✭ 139 (-4.79%)
Mutual labels:  websockets
Tk Http
Full featured HTTP and Websockets library for rust/tokio
Stars: ✭ 132 (-9.59%)
Mutual labels:  websockets
Rfc6455
I/O agnostic WebSocket Protocol
Stars: ✭ 133 (-8.9%)
Mutual labels:  websockets
Http
An opinionated framework for scalable web 🌎
Stars: ✭ 136 (-6.85%)
Mutual labels:  websockets
Weewx Belchertown
A clean and modern weewx skin with real time streaming updates, forecast data and interactive charts. View it in action at BelchertownWeather.com
Stars: ✭ 131 (-10.27%)
Mutual labels:  websockets
Carrot
Distributed WebSocket and HTTP Load Testing Framework in Go
Stars: ✭ 143 (-2.05%)
Mutual labels:  websockets
Sish
HTTP(S)/WS(S)/TCP Tunnels to localhost using only SSH.
Stars: ✭ 2,087 (+1329.45%)
Mutual labels:  websockets
Actix Web
Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust.
Stars: ✭ 12,723 (+8614.38%)
Mutual labels:  websockets
Websocket
WSServer is a fast, configurable, and extendable WebSocket Server for UNIX systems written in C (C11).
Stars: ✭ 144 (-1.37%)
Mutual labels:  websockets
Wsstat
Websocket stress testing made beautiful
Stars: ✭ 143 (-2.05%)
Mutual labels:  websockets
Azure Signalr
Azure SignalR Service SDK for .NET
Stars: ✭ 137 (-6.16%)
Mutual labels:  websockets

minchat

基于tomcat 7. 0.56 websocket的在线客服系统

##WebSocket 介绍

WebSocket协议是一种双向通信协议,它建立在TCP之上,同http一样通过TCP来传输数据,但是它和http最大的不同有两点:1.WebSocket是一种双向通信协议,在建立连接后,WebSocket服务器和Browser/UA都能主动的向对方发送或接收数据,就像Socket一样,不同的是WebSocket是一种建立在Web基础上的一种简单模拟Socket的协议;2.WebSocket需要通过握手连接,类似于TCP它也需要客户端和服务器端进行握手连接,连接成功后才能相互通信。

下面是一个简单的建立握手的时序图:

image

javascript代码,该代码调用了WebSockets的API:

  1. var ws = new WebSocket(“ws://echo.websocket.org”);
  2. ws.onopen = function(){ws.send(“Test!”); };
  3. ws.onmessage = function(evt){console.log(evt.data);ws.close();};
  4. ws.onclose = function(evt){console.log(“WebSocketClosed!”);};
  5. ws.onerror = function(evt){console.log(“WebSocketError!”);};

第一行代码是在申请一个WebSocket对象,参数是需要连接的服务器端的地址,同http协议使用http://开头一样,WebSocket协议的URL使用ws://开头,另外安全的WebSocket协议使用wss://开头。

第二行到第五行为WebSocket对象注册消息的处理函数,WebSocket对象一共支持四个消息 onopen, onmessage, onclose和onerror,当Browser和WebSocketServer连接成功后,会触发onopen消息;如果连接失败,发送、接收数据失败或者处理数据出现错误,browser会触发onerror消息;当Browser接收到WebSocketServer发送过来的数据时,就会触发onmessage消息,参数evt中包含server传输过来的数据;当Browser接收到WebSocketServer端发送的关闭连接请求时,就会触发onclose消息。我们可以看出所有的操作都是采用消息的方式触发的,这样就不会阻塞UI,使得UI有更快的响应时间,得到更好的用户体验。


##系统实现

  • 架构:springmvc+mybatis+shiro+mysql+websocket

  • 访客人员地址:http://localhost:8080/chat/guest

  • 客服人员登录地址:http://localhost:8080/chat/customer admin/admin

  • 备注:

  • js发起ws请求时,没有加web context,所以在访问系统的时候,也不要加context,如果需要加context,则修改guest.js文件把context加上

 Chat.initialize = function() {
     if (window.location.protocol == 'http:') {
         Chat.connect('ws://' + window.location.host + '/message'+window.location.search);
     } else {
         Chat.connect('wss://' + window.location.host + '/message'+window.location.search);
     }
};

###系统实现截图 image

image

image

image

image

image

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