Files
Blog/content/posts/2026/rust/cargo-proxy.md
T
2026-05-30 00:42:21 +03:00

38 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "🫧 Использование Proxy в Cargo"
date: 2026-05-30T00:31:04+03:00
draft: false
tags: [rust, cargo, tips, proxy]
---
## Введение
**Cargo** не работает с переменным окружения `http_proxy` и `https_proxy`
для использования прокси.
Настройка Cargo, в том числе прокси, осуществляется через файл конфигурации
`~/.cargo/config.toml` (ранее расширение `*.toml` не было нужно).
В версии `1.95.0` **Cargo** просит использовать `Toml` формат конфигурации.
```text
warning: `/home/user/.cargo/config` is deprecated in favor of `config.toml`
|
= help: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
Updating crates.io index
```
## Пример использования прокси
```toml
# ~/.cargo/config.toml
[http]
debug = false
proxy = "host:port"
# proxy = "127.0.0.1:2080"
```
[Полная справка](https://doc.rust-lang.org/cargo/reference/config.html) по настройке **Cargo**.