◢ ALSALLAM//SEC CASE FILE02 / 14 visitor@sandbox:~/projects/barq ← QumraallGUARDRAIL PROTOCOL →
Download list with active segmented transfers
1/3 · Download list with active segmented transfers
22k
lines of Rust
~6×
speedup vs a single connection
65
tests
// brief

Barq is my attempt to rebuild Internet Download Manager’s acceleration on Linux as a native app. Barq means lightning in Arabic. I wanted the real segmented-download algorithm, not just parallel connections, wrapped in a GTK4 interface and a browser extension that actually intercepts downloads.

The engine lives in barq-core, a library with zero GTK dependencies built on tokio and reqwest. It uses a connection-slot model where bounded sub-range requests ride keep-alive connections, and a segment’s end is moved by bisection so a connection is never aborted mid-flight. Progress is checkpointed to a .barq sidecar next to a preallocated .part file, which is what makes resume byte-perfect after a hard kill. A regression test guards roughly a 6x speedup over a single connection.

The workspace also has barq-host, a native-messaging shim that forwards captured URLs to the app over D-Bus, plus an MV3 extension shared across Chromium and Firefox.

// capabilities
  • Dynamic segmentation with largest-segment bisection over keep-alive slots
  • Byte-perfect resume from a sidecar control file after kill -9
  • MV3 extension plus a native-messaging host that forwards URLs over D-Bus
  • HLS and DASH capture, site grabber, scheduler and per-server rules
  • Hierarchical rate limiting, per-site proxy and keyring-stored logins
  • SQLite persistence with WAL, credentials in the Secret Service keyring