Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "io.http", | ||
"version": "0.0.5", | ||
"author": "Vitaly Anagorsky <vitaly@anagorsky.com>" | ||
"version": "0.0.6", | ||
"author": "Vitaly Anagorsky <vitaly@anagorsky.com>", | ||
"dependencies": { | ||
"io.crypto": "latest" | ||
} | ||
} |
@@ -10,5 +10,9 @@ | ||
const | ||
___guid = require('io.guid'), | ||
___crypto = require('io.crypto') | ||
class Server extends events { | ||
constructor (port) { | ||
constructor (options) { | ||
@@ -21,4 +25,6 @@ super() | ||
this.___listen(port) | ||
this.___options = options | ||
this.___listen() | ||
} | ||
@@ -50,3 +56,3 @@ | ||
___listen (port) { | ||
___listen () { | ||
@@ -59,3 +65,3 @@ this.___server = new http.Server() | ||
.on('request', (req, res) => this.___onRequest(req, res)) | ||
.listen(port, '127.0.0.1') | ||
.listen(this.___options.port, this.___options.host || '127.0.0.1') | ||
@@ -202,2 +208,8 @@ } | ||
if (this.___options.crypto) { | ||
data = ___crypto.encrypt(data, this.___options.crypto.key, this.___options.crypto.algorithm) | ||
} | ||
res.end(data) | ||
@@ -283,2 +295,3 @@ | ||
destroy: () => this.___destroy(req, res), | ||
crypto: this.___options.crypto || null | ||
} | ||
@@ -285,0 +298,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5552
184
1
+ Addedio.crypto@latest
+ Addedio.crypto@0.0.1(transitive)