Skip to content

Instantly share code, notes, and snippets.

@thegreatape
Created February 7, 2011 20:28
Show Gist options
  • Save thegreatape/815123 to your computer and use it in GitHub Desktop.
Save thegreatape/815123 to your computer and use it in GitHub Desktop.
var pcap = require('pcap');
var session1 = pcap.createSession('en0', "ip proto \\tcp", (10 * 1024 * 1024));
session1.on('packet', function(packet){
console.log('session 1 packet');
});
session1.removeAllListeners();
session1.close();
var session2 = pcap.createSession('en0', "ip proto \\tcp", (10 * 1024 * 1024));
session2.on('packet', function(packet){
console.log('session 2 packet');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment