Skip to content

Instantly share code, notes, and snippets.

@aroman
Created March 22, 2013 17:42
Show Gist options
  • Save aroman/5223252 to your computer and use it in GitHub Desktop.
Save aroman/5223252 to your computer and use it in GitHub Desktop.
Y U NO FIRE?
http = require "http"
querystring = require "querystring"
options =
hostname: 'www.google.com',
path: '/',
method: 'GET'
req = http.request options, (res) ->
# If I remove the following line, 'end' will never be fired.
res.on 'data', -> return
res.on 'end', ->
console.log "end fired"
req.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment