Pipes raw 802.11 packets from a NATS connection into wireshark (tshark) and sends a json version of the packet back to the NATS server
  • JavaScript 100%
Find a file
2026-04-10 21:34:16 +02:00
its-bridge.js Initial commit 2026-04-10 21:34:16 +02:00
package.json Initial commit 2026-04-10 21:34:16 +02:00
README.md Initial commit 2026-04-10 21:34:16 +02:00

cits-wireshark-bridge

Node.js script that bridges raw 802.11 packets on NATS into tshark, and publishes the decoded JSON back to NATS.

We use it for our opentrafficmap.org project.

Requirements

  • Node.js 18 or newer
  • nats for Node.js (npm install)
  • tshark installed and available in PATH
  • A reachable NATS server

Environment

  • NATS_URL: NATS server URL, for example nats://127.0.0.1:4222
  • NATS_USERNAME, NATS_PASSWORD: optional credentials
  • INPUT_SUBJECT: subscription subject, default its.*.packet
  • OUTPUT_SUBJECT: fixed publish subject; if unset, the bridge publishes to <source-subject>.json
  • OUTPUT_SUFFIX: suffix used when OUTPUT_SUBJECT is unset, default .json
  • PCAP_SNAPLEN: PCAP snapshot length, default 65535
  • PCAP_LINKTYPE: PCAP link type, default 105
  • TSHARK_BIN: path to tshark, default tshark
  • TSHARK_PROTOCOL_FILTER: optional -J protocol filter for tshark
  • TSHARK_INCLUDE_HEX: set to 1, true, or yes to include hex output
  • VERBOSE: set to 1, true, or yes for extra logging

Run

NATS_URL=nats://127.0.0.1:4222 \
INPUT_SUBJECT='its.*.packet' \
node its-bridge.js