main; remove socket-io wildcard dependency
This commit is contained in:
parent
733eaa2b60
commit
42e1c5ff21
2 changed files with 5 additions and 12 deletions
|
|
@ -4,7 +4,6 @@ var express = require('express')(),
|
|||
http = require('http'),
|
||||
server = http.createServer(express),
|
||||
io = require('socket.io')(),
|
||||
ioWildcard = require('socketio-wildcard')(),
|
||||
ipc = {},
|
||||
settings = require('./settings'),
|
||||
appAddresses = settings.read('appAddresses'),
|
||||
|
|
@ -18,9 +17,6 @@ express.get('*', function(req, res){
|
|||
})
|
||||
|
||||
|
||||
io.use(ioWildcard)
|
||||
|
||||
|
||||
io.listen(server)
|
||||
|
||||
server.listen(settings.read('httpPort'))
|
||||
|
|
@ -38,13 +34,11 @@ var bindCallbacks = function(callbacks) {
|
|||
|
||||
clients[socket.id] = socket
|
||||
|
||||
socket.on('*', function(e){
|
||||
var name = e.data[0],
|
||||
data = e.data[1]
|
||||
|
||||
|
||||
if (callbacks[name]) callbacks[name](data,socket.id)
|
||||
})
|
||||
for (let name in callbacks) {
|
||||
socket.on(name, (data)=>{
|
||||
callbacks[name](data,socket.id)
|
||||
})
|
||||
}
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue