---
url: /configuration/http-client.md
description: 规则集和 provider 下载经过的出站、TLS 和请求头
---

# http_clients

定义可复用的下载客户端。

```yaml check
http_clients:
  archive:
    via: DIRECT
    header:
      User-Agent: mayami

dns:
  servers:
    default: {type: udp, address: 127.0.0.1:53}
  final: default
```

## 字段

### via

* 类型：出站名。
* 必填：可选。
* 默认：`route.final`。

### tls

* 类型：[TLS 客户端块](/configuration/shared/tls-client)。
* 必填：可选。
* 默认：TLS 客户端默认值，并自动提供 HTTP/1.1 ALPN。

### header

* 类型：映射；每个头可写一个字符串或字符串数组。
* 必填：可选。
* 默认：空。

## 说明

规则集或 provider 自己的 `http_client`、`via`、`header` 可以覆盖这里的选择。`route.default_http_client` 只在调用处没有命名客户端时生效。

## 相关

* [TLS 客户端](/configuration/shared/tls-client)
* [provider](/configuration/provider)
* [路由 rule_set](/configuration/route/rule-set)
