Skip to content
akan.dev
Bayram AkanProjects

indir

A small, free download manager for Windows, macOS and Linux. Paste a link and it fetches the file in parts over several connections at once, then pauses and resumes it, even after a restart.

Period
– Present
Stack
Rust, Tokio, Tauri 2, JavaScript, GitHub Actions
Licence
MIT, open source

Overview

A browser fetches a file over one connection, and many servers cap how fast a single connection may go, so a big file crawls. indir splits the file into parts, fetches them side by side and puts them back together. It is Internet Download Manager's one good idea with everything else taken out: one window, one field to paste into, two settings. Free, open source, no account and no tracking.

indir with two files downloading in parts, one paused and one finished

How the engine works

The engine is a Rust library of its own (indir-engine, on Tokio and reqwest), with no UI, so it can be tested and run from a terminal on its own.

  1. One small question first. It asks the server for the file's first byte. A 206 Partial Content answer means any part of the file can be fetched, and gives its size. A server that can't gets one ordinary connection.
  2. The file is split into one part per connection, none under 1 MB. Each part is an HTTP Range request with If-Range, so a file that changes on the server is noticed instead of two versions being mixed, and is written straight to its place on disk. Connections speak HTTP/1.1 on purpose: HTTP/2 would carry them all over one TCP connection, which is what a download manager exists to avoid.
  3. Free connections help the others. A connection that finishes takes over the second half of the biggest part still running. One that has sent nothing for 5 seconds, or crawls at a sixteenth of another's speed, is taken over whole: some servers keep the extra connections at a trickle on purpose.
  4. It backs off when a server wants it to. On 429 Too Many Requests, or when the connections crawl, it tries a single connection for a few seconds and keeps whichever way is faster. It is never meant to be slower than a browser.
  5. Nothing counts until it is on disk. Every two seconds the written data is flushed to the disk for good, and the saved progress counts only those bytes, so a crash or a power cut costs a few seconds at most.

A dropped or stalled connection is reopened exactly where it stopped, and a signed download address that expires, as GitHub's release links do, is simply asked for again.

The app

The desktop app is built with Tauri 2: the engine in Rust, the window in plain HTML, CSS and JavaScript with no build step. Each download's bar is the whole file with every part filling in from its own start, and the parts close up into one bar when it is done. Light and dark follow the system, and progress shows on the taskbar button or the Dock icon.

Testing and releases

The engine's tests download from a local server that can be slow, drop connections, refuse extra ones, trickle, go silent or change the file halfway. Real-world speed is measured against cdn.kernel.org rather than speed-test sites, which punish parallel connections. Pushing a version tag builds and publishes everything through GitHub Actions: a Windows installer and portable exe, a universal macOS disk image, and Linux AppImage, .deb and .rpm packages.


Source and downloads at github.com/akancodes/indir. MIT licence.