Comparing version 0.0.4 to 0.0.5
@@ -14,4 +14,12 @@ /* | ||
* labeled "Your Authentication Key:" | ||
*//*jshint devel:true, node:true, indent:2, maxerr:50 */(function() { | ||
*/ | ||
/*jshint devel:true, node:true, indent:2, maxerr:50 */ | ||
(function() { | ||
"use strict"; | ||
var debug; | ||
if (process.env.NODE_DEBUG && /404project/.test(process.env.NODE_DEBUG)) { | ||
debug = function(x) { console.error('404project: %s', x); }; | ||
} else { | ||
debug = function() { }; | ||
} | ||
var https = require("https"); | ||
@@ -42,3 +50,3 @@ function formatYmd(ts) { | ||
res.on("data", function(chunk) { | ||
// console.log(chunk); | ||
debug(chunk); | ||
}); | ||
@@ -71,7 +79,5 @@ }); | ||
}; | ||
if (next) { | ||
return next(); | ||
} | ||
return next && next(); | ||
}; | ||
}; | ||
})(); |
{ | ||
"name": "404project", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Report 404 errors to http://www.dshield.org/tools/404project.html", | ||
@@ -5,0 +5,0 @@ "keywords": ["security", "http", "https", "connect", "express"], |
@@ -16,2 +16,6 @@ node-404project | ||
### Express.js | ||
Using as a plugin for express.js: | ||
``` | ||
@@ -22,3 +26,3 @@ var express = require("express"); | ||
var myKey = process.argv[3] || "[Your Authentication Key]"; | ||
var app = module.exports = express.createServer(); | ||
var app = express.createServer(); | ||
@@ -29,2 +33,40 @@ app.use(reporter(myUserID, myKey)); | ||
### Connect.js | ||
The same code also works for connect.js. Just replace | ||
``` | ||
var express = require("express"); | ||
``` | ||
with | ||
``` | ||
var express = require("connect"); | ||
``` | ||
### Other Frameworks | ||
Users of different frameworks can call the functionreturned by ``reporter(myUserID, myKey)`` directly using: | ||
``` | ||
// ... | ||
var report = reporter(myUserID, myKey); | ||
report(request, response); | ||
// ... | ||
``` | ||
or | ||
``` | ||
// ... | ||
var report = reporter(myUserID, myKey); | ||
report(url, ip, ua, timestamp); | ||
// ... | ||
``` | ||
### Command-Line Support | ||
There is also a command-line tool: | ||
@@ -34,2 +76,2 @@ | ||
bin/404reporter 036742670 aaaaaaaaaaaabbcccccccccccceeeeeeeeffffff "http://www.jolira.com/__phpamdin" 125.64.23.180 jakarta | ||
``` | ||
``` |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
6669
85
74
3