root 3bf41bf355 update | il y a 1 an | |
---|---|---|
.. | ||
LICENSE | il y a 1 an | |
README.md | il y a 1 an | |
index.js | il y a 1 an | |
package.json | il y a 1 an | |
test.js | il y a 1 an |
Enable destroying a server, and all currently open connections.
var enableDestroy = require('server-destroy');
var server = http.createServer(function(req, res) {
// do stuff, blah blah blah
});
server.listen(PORT);
// enhance with a 'destroy' function
enableDestroy(server);
// some time later...
server.destroy();