Skip to content
GitHub

Configure Rust

Replace crates.io with Depsilo's sparse index so Cargo dependencies use the proxy cache.

BEFOREhttps://index.crates.io
AFTERhttp://localhost:23333/crates/

Cargo must replace crates.io with Depsilo. Merely adding a named registry does not change the default source.

~/.cargo/config.toml
[source.crates-io]
replace-with = "depsilo"
[source.depsilo]
registry = "sparse+http://localhost:23333/crates/"

The sparse+ prefix is required. Depsilo serves Cargo at /crates/, not /cargo/.

终端窗口
cargo fetch
  1. Check that the instance is ready

    终端窗口
    curl -fsS http://localhost:23333/ready
  2. Fetch dependencies in a scratch project

    终端窗口
    cargo new --quiet /tmp/depsilo-cargo && cd /tmp/depsilo-cargo
    cargo add --quiet serde
    cargo fetch
  3. Confirm the traffic in Admin

    Check the /crates/ requests in Access logs; repeating cargo fetch should hit the cache.

Depsilo’s Cargo route is /crates/, matching the sparse registry protocol. The wrong path returns 404 rather than falling back upstream.

Configure each additional registry as its own source. Depsilo only replaces the sources you explicitly point at it.