npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tdole/pcaptorabbit

v2.5.2

Published

pcaptorabbit ============

Downloads

123

Readme

pcaptorabbit

With this program you can monitor a folder for new pcap files and send the data to a RabbitMQ. Each pcap packet will become a single message in Rabbit RabbitMQ. The message is a json object with all the information about the source of the pcap packet.

Requirements:

  • NodeJS (v20.0.0 or higher).
  • Capture file must be in pcap or pcap-ng (data in 'Enhanced Packet Block' blocks) format.

Installation:

This programm also exists on the online NPM repository. Install from there with 'npm install @todle/pcaptorabbit -g'. This will install de program 'pcaptorabbit' globally.

To install the checkedout git repository version use the command 'npm install -g' will install the program 'pcaptorabbit' globally.

Usage

Usage: pcaptorabbit [options]
Show this help message
    --help
Only process tipcp packets and split them over multiple queues based on least significant ip address byte.
    --splitIp
Only process tcp packets and split them over multiple queues based on ip-port combinations.
    --splitTcp
Only ouput packets to/from specified port(s) (comma separated list of port numbers)
    --portfilter <value>
Number of queues to write to Quename will be '<quename>_<#>'. (Default: 1).
    --queueCount <value>
Path to file when it exists the processing of files is paused at the next file. Default not used.
    --pauseFile <value>
RabbitMq queue (Default: 10). Use -1 for indefinitly
    --amqpReconnectTries <value>
RabbitMq queue (Default: 20 seconds)
    --amqpReconnectTimeout <value>
RabbitMq queue (Default: pcap)
    --amqpQueue <value>
Lawfull intercept ID (Default: pcap)
    --amqpRoutingKey <value>
RabbitMQ exchange (Default: pcap)
    --amqpExchange <value>
URI to amqp (RabbitMQ) host (Default: amqp://localhost)
    --amqpHost <value>
Path to folder to move pcap files to after an error
    -e, --errorpath <value>
Path to folder to move pcap files to after reading
    -o, --outpath <value>
Path to pcap files to read
    -i, --inpath <value>
Regular expression for filename(s) to find. Default: '.*'.
    -p, --pattern <value>
When processing multiple files (--inpath or --fileList) do not move file to specified out path (--outpath).
    --doNotMoveAfterProcessing
File containing list of files to process. One file per line.
    --fileList <value>
Read only specified file
    -f, --filename <value>
Show extra debug info
    -d, --debug

For examle read all existing and new pcap files below "/data/in".

pcaptorabbit -i "/data/in/" -p ".*\\.pcap$" -o "/data/out/" -e "/data/error/"

The "-p" ("--pattern") argument is a javascript regular expression. You must escape backslashes once if you want them to be used as a regular espression backslash and twice if you want it to be a backslash character in you regular expression. So ".*\\.pcap$" becomes ".*\.pcap$" for your javascript regular expression and ".*\\\.pcap$" becomes ".*\\.pcap$".

The data is send packet as a protocol buffer. For the layout see the 'pcaptorabbit.proto' file.

IP or TCP packet can be split over multiple RabbitMQ queues to spread the load. For this use the "--queueCount", "--splitTcp" or "--splitIp" options. For TCP all packets of the same session (tuple address) are send to the same queue and for IP the least significat byte of the address is used to determine the queue.

When "--splitTcp" option is used yo can also use the "--portfilter" option to oly send TCP packets where the source or destination port is in the port filter list. Limiting the amount of data send to RabbitMQ.

When "--queueCount" is 1 then data is send to the specified queue name without the count index "<queuename>". When this value is bigger than 1 then queue's are created with thename "<queuename>_<#>".