Skip to content

Instantly share code, notes, and snippets.

@ralphtheninja
Forked from juliangruber/gist:5099457
Created March 6, 2013 14:26
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 ralphtheninja/5099643 to your computer and use it in GitHub Desktop.
Save ralphtheninja/5099643 to your computer and use it in GitHub Desktop.
var stream = createStream()
net.createServer(function (con) {
con.on('data', function (data) {
console.log('S <- ' + data.toString())
})
stream.on('data', function (data) {
console.log('S -> ' + data.toString())
})
stream.pipe(con).pipe(stream)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment