How to use select-hose - 2 common examples

To help you get started, we’ve selected a few select-hose examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spdy-http2 / node-spdy / lib / spdy / server.js View on Github external
proto._onPlainConnection = function _onPlainConnection (socket) {
  var hose = selectHose.create(socket, {}, hoseFilter)

  var self = this
  hose.on('select', function (protocol, socket) {
    self._handleConnection(socket, protocol)
  })

  hose.on('error', function (err) {
    debug('hose error %j', err.message)
    socket.destroy()
  })
}
github sx1989827 / DOClever / Desktop / node_modules / spdy / lib / spdy / server.js View on Github external
proto._onPlainConnection = function _onPlainConnection (socket) {
  var hose = selectHose.create(socket, {}, hoseFilter)

  var self = this
  hose.on('select', function (protocol, socket) {
    self._handleConnection(socket, protocol)
  })

  hose.on('error', function (err) {
    debug('hose error %j', err.message)
    socket.destroy()
  })
}

select-hose

Select protocol using first bytes of incoming data and hose stuff to the handler

MIT
Latest version published 9 years ago

Package Health Score

65 / 100
Full package analysis

Popular select-hose functions