|
@ -46,13 +46,21 @@ server.listen(common.PORT, function() { |
|
|
|
|
|
|
|
|
res.on('data', function(chunk) { |
|
|
res.on('data', function(chunk) { |
|
|
console.log('Read ' + chunk.length + ' bytes'); |
|
|
console.log('Read ' + chunk.length + ' bytes'); |
|
|
console.log(chunk.toString()); |
|
|
console.log(' chunk=%j', chunk.toString()); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
res.on('end', function() { |
|
|
res.on('end', function() { |
|
|
console.log('Response ended.'); |
|
|
console.log('Response ended.'); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
res.on('aborted', function() { |
|
|
|
|
|
console.log('Response aborted.'); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
res.socket.on('close', function() { |
|
|
|
|
|
console.log('socket closed, but not res'); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// it would be nice if this worked:
|
|
|
// it would be nice if this worked:
|
|
|
res.on('close', function() { |
|
|
res.on('close', function() { |
|
|
console.log('Response aborted'); |
|
|
console.log('Response aborted'); |
|
|