Permalink
Browse files

Version checking bugfix.

  • Loading branch information...
1 parent 05eb427 commit 70b9f57805bb0c0aad748e5206d26d659d5b3703 @mranney mranney committed Dec 6, 2010
Showing with 10 additions and 24 deletions.
  1. +6 −20 README.md
  2. +1 −1 changelog.md
  3. +2 −2 pcap.js
  4. +1 −1 pcap_binding.cc
View
@@ -5,11 +5,10 @@ This is a set of bindings from `libpcap` to node as well as some useful librarie
analyze packets. `libpcap` is a packet capture library used by programs like `tcpdump` and `wireshark`.
It has been tested on OSX and Linux.
-`node_pcap` is useful for many things, but it does not yet understand all common protocols. A popular reason
-to use this package is `examples/http_trace`, described below.
-
-Another great reason to use `node_pcap` is
-[htracr](https://github.com/mnot/htracr), written by Mark Nottingham.
+`node_pcap` is useful for many things, but it does not yet understand all common protocols. Common reasons
+to use this package are
+[http_trace](https://github.com/mranney/http_trace), and
+[htracr](https://github.com/mnot/htracr).
## Why capture packets in JavaScript?
@@ -169,7 +168,7 @@ new events will be emitted:
* `http_response_complete`: function(session, http)
-See `examples/http_trace` for an example of how to use these events to decode HTTP.
+See `http_trace` for an example of how to use these events to decode HTTP.
### WebSocket Analysis
@@ -178,7 +177,7 @@ The `TCP_tracker` further detects and decodes WebSocket traffic on all streams i
* `websocket_upgrade`: function(session, http)
* `websocket_message`: function(session, dir, message)
-See `examples/http_trace` for an example of how to use these events to decode WebSocket.
+See `http_trace` for an example of how to use these events to decode WebSocket.
## Some Common Problems
@@ -226,19 +225,6 @@ If the pcap filters are set correctly and `libpcap` still drops packets, it is p
buffer size. At the moment, this requires changing `pcap_binding.cc`. Look for `pcap_set_buffer_size()` and
set to a larger value.
-## examples/http_trace
-
-This is a handy standalone program that can help diagnose HTTP and WebSocket traffic.
-
-The TCP tracker looks for HTTP at the beginning of every TCP connection. If found, all captured on this connection
-will be fed to node's HTTP parser and events will be generated. `http_trace` has listeners for these events and will
-print out some helpful information.
-
-If a WebSocket upgrade is detected, `http_trace` will start looking for WebSocket messages on that connection.
-
-![http_trace screenshot](http://ranney.com/httptrace.jpg)
-
-
## examples/simple_capture
This program captures packets and prints them using the built in simple printer. Here's a sample of it's output.
View
@@ -1,7 +1,7 @@
Changelog
=========
-## v0.2.4 - December 5, 2010
+## v0.2.6 - December 5, 2010
Should now compile properly on node 0.2.x and 0.3.x.
View
@@ -8,7 +8,7 @@ var util, IOWatcher,
HTTPParser = process.binding('http_parser').HTTPParser,
url = require('url');
-if (process.versions && process.versions.node && process.versions.node.split()[1] >= 3) {
+if (process.versions && process.versions.node && process.versions.node.split('.')[1] >= 3) {
util = require("util");
IOWatcher = process.binding('io_watcher').IOWatcher;
} else {
@@ -44,7 +44,7 @@ Pcap.prototype.open = function (live, device, filter, buffer_size) {
this.link_type = binding.open_live(this.device_name, filter || "", this.buffer_size);
} else {
this.device_name = device;
- this.link_type = binding.open_offline(device, filter || "", this.buffer_size);
+ this.link_type = binding.open_offline(this.device_name, filter || "", this.buffer_size);
}
this.fd = binding.fileno();
View
@@ -125,7 +125,7 @@ Open(bool live, const Arguments& args)
return ThrowException(Exception::TypeError(String::New("pcap Open: args[2] must be a Number")));
}
} else {
- return ThrowException(Exception::TypeError(String::New("pcap Open: wrong number of arguments")));
+ return ThrowException(Exception::TypeError(String::New("pcap Open: expecting 3 arguments")));
}
String::Utf8Value device(args[0]->ToString());
String::Utf8Value filter(args[1]->ToString());

0 comments on commit 70b9f57

Please sign in to comment.