Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Getting Client IP in CoffeeScript
http.get { host: '' }, (res) ->
data = ''
res.on 'data', (chunk) ->
data += chunk.toString()
res.on 'end', () ->
console.log data.match(/([0-9]+\.){3}[0-9]+/)[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.