Skip to content

Instantly share code, notes, and snippets.

@juliangruber
Created March 6, 2013 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save juliangruber/5099457 to your computer and use it in GitHub Desktop.
Save juliangruber/5099457 to your computer and use it in GitHub Desktop.
inspect tcp traffic
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