cryptotranny
Advanced tools
Comparing version 1.0.5 to 1.0.6
25
index.js
@@ -36,2 +36,6 @@ // Always use strict mode | ||
}); | ||
this._socket.on ('close', () => { | ||
this.emit ('disconnected'); | ||
}); | ||
} | ||
@@ -44,2 +48,7 @@ | ||
} | ||
// Destroy underlying sock connection | ||
destroy () { | ||
this._socket.destroy (); | ||
} | ||
} | ||
@@ -53,3 +62,6 @@ | ||
// Private variables | ||
// Public properties | ||
this.pk = theirPk; | ||
// Private properties | ||
this._netConn = netConn; | ||
@@ -69,2 +81,6 @@ | ||
}); | ||
this._netConn.on ('disconnected', () => { | ||
this.emit ('disconnected'); | ||
}); | ||
} | ||
@@ -109,2 +125,7 @@ | ||
} | ||
// Destroy underlying netconn | ||
destroy () { | ||
this._netConn.destroy (); | ||
} | ||
} | ||
@@ -156,4 +177,6 @@ | ||
function genKeyPair () { | ||
// Generate keys using nacl | ||
let naclKeyPair = nacl.box.keyPair (); | ||
// Return in cryptotranny formatting | ||
return { | ||
@@ -160,0 +183,0 @@ pk : Buffer.from (naclKeyPair.publicKey), |
{ | ||
"name": "cryptotranny", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Simple Cryptographic Transport", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5253
145