MCSManager/model/WebSocketModel.js
2018-04-13 09:55:43 +08:00

12 lines
355 B
JavaScript

const EventEmitter = require('events');
const observerModel = require('./ObserverModel');
//事件二次转发 监听ws/req即可监听所有Websocket请求
observerModel.listener('ws/req', '', (data) => {
let event = data.RequestValue;
observerModel.emit(event, data);
});
module.exports.WebSocketObserver = () => {
return observerModel;
}