Skip to content

Instantly share code, notes, and snippets.

@diversario
Created September 11, 2013 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diversario/6528845 to your computer and use it in GitHub Desktop.
Save diversario/6528845 to your computer and use it in GitHub Desktop.
request #304, multiple `error` events on timeout
require('http').Server(function (req, res) {})
.listen(28423, '127.0.0.1', function () {
var request = require('request')
request({
"method": "GET",
"uri": "http://127.0.0.1:28423",
"timeout": 1000
}).on('error', function(e){
console.log('error')
console.log(e.code, e.message);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment