emilbayes / noise-peer

Simple end-to-end encrypted, secure channels using Noise Protocol Framework and libsodium secretstream
ISC License
147 stars 13 forks source link

client crashes when server crashes #4

Closed robertkowalski closed 5 years ago

robertkowalski commented 5 years ago

expected: client has an error/message "server closes the connection".

with noise network module:

server.on('connection', function (encryptedStream) {
  throw new Error('boom') 
 // [...]
/Users/robert/bitfinex/hypertest/node_modules/noise-network/index.js:223
    this.discovery.close()
                   ^

TypeError: this.discovery.close is not a function
    at NoiseAgent._close (/Users/robert/bitfinex/hypertest/node_modules/noise-network/index.js:223:20)
    at NoiseAgent.Nanoresource.close (/Users/robert/bitfinex/hypertest/node_modules/nanoresource/index.js:95:8)
    at NoiseAgent.Nanoresource.inactive (/Users/robert/bitfinex/hypertest/node_modules/nanoresource/index.js:64:33)
    at RawStream._onclose (/Users/robert/bitfinex/hypertest/node_modules/noise-network/index.js:145:16)
    at RawStream.emit (events.js:187:15)
    at RawStream.Duplexify._destroy (/Users/robert/bitfinex/hypertest/node_modules/duplexify/index.js:199:8)
    at /Users/robert/bitfinex/hypertest/node_modules/duplexify/index.js:182:10
    at process._tickCallback (internal/process/next_tick.js:61:11)
emilbayes commented 5 years ago

Worng repo :) Open on mafintosh/noise-network

robertkowalski commented 5 years ago

i think this is fixed now