- Put those files into your play ground.
- Choose your node version to 0.10.5 and install dependencies.
npm install
- Start the server.
coffee server.coffee
- Run client script, two requests will be sent, a PUT request and a HEAD request, the PUT request will get response as expected, but the HEAD request will not.
coffee client.coffee
{ [Error: socket hang up] code: 'ECONNRESET' }
/Users/simsicon/sites/debug_path/client.coffee:40
return console.log(res.headers);
^
TypeError: Cannot read property 'headers' of undefined
at /Users/simsicon/sites/debug_path/client.coffee:40:29
at ClientRequest.<anonymous> (/Users/simsicon/sites/debug_path/client.coffee:16:14)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketOnEnd [as onend] (http.js:1520:9)
at Socket.g (events.js:175:14)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:895:16
at process._tickCallback (node.js:415:13)