Skip to content

Instantly share code, notes, and snippets.

@runvnc
Created August 25, 2012 19:30
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 runvnc/3469836 to your computer and use it in GitHub Desktop.
Save runvnc/3469836 to your computer and use it in GitHub Desktop.
connect to tcp socket in node.js
socket = net.createConnection port, host
socket.on "data", (data) ->
console.log "RESPONSE: " + data
socket.on "connect", ->
socket.write "GET / HTTP/1.0\r\n\r\n"
socket.on "end", ->
console.log "DONE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment