Forum: Ruby Process PCAP Data from Socket

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bryan R. (Guest)
on 2009-02-16 18:14
Hello all,

I'm wondering if it's possible at all to process PCAP data using Ruby's
pcap library when the data's being piped through a socket.  The pcap
library has capture methods for live capture from a device or offline
via a file.  I'm piping PCAP data from a remote machine to my machine
using netcat, and I want to be able to process it in real-time on my

Does anyone know if I can pass an IO handle to the offline method in the
Ruby pcap library?

Eleanor McHugh (Guest)
on 2009-02-17 16:40
(Received via mailing list)
On 16 Feb 2009, at 16:16, Bryan R. wrote:
> Ruby pcap library?
I can't comment on your particular case, but assuming your box is much
faster than the network link reading data in realtime and doing
something with it is certainly possible. If you follow the link in my
sig and grab a copy of the Camping presentation there are some
examples of using Ruby PCAP that may help.


Eleanor McHugh
Games With Brains
raise ArgumentError unless @reality.responds_to? :reason
This topic is locked and can not be replied to.