Created
August 25, 2012 19:30
-
-
Save runvnc/3469836 to your computer and use it in GitHub Desktop.
connect to tcp socket in node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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