J
J
jenya77712019-01-17 22:34:25
css
jenya7771, 2019-01-17 22:34:25

Why is data not being passed from the Socket.io middleware?

Hello, I have this code

const io = socketio.listen(server)
    io.use(sharedsession(session, {
        autoSave: true
    }))
    io.use(servises.cash.getSocket())

    io.of('/chat')
    .on('connection', (socket) => {

        console.log(socket.user)
    })

   //servises.cash.getSocket()
exports.getSocket = () => {

  return function (socket, next) {
        socket.user = {
            login: 'User'
        }
        next()
    }
}

Why if there is no specific path for the socket (without .of('/chat')) everything works and the user object can be obtained, but as soon as I add the /chat path it doesn't work? This is necessary to get the cache, is it possible to somehow put an intermediate handler to a specific path?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Bulgakov, 2016-05-05
@dKosolap

parent container - font-size: 0; well, in the buttons then rewrite your font-size

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question