---
url: /configuration/outbound/http.md
description: 通过 HTTP CONNECT 代理出站
---

# http

经 HTTP 代理的 CONNECT 建立 TCP 流，并使用代理自己的 UDP-over-TCP/XUDP 承载能力。

```yaml check
outbounds:
  proxy:
    type: http
    server: proxy.example:8080
    username: alice
    password: secret

route:
  final: proxy

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

## 字段

### type

* 类型：字符串。
* 必填：是，第一项。
* 取值：`http`。

### server

* 类型：端点。
* 必填：是。
* 默认端口：`443`。

### tls

* 类型：[TLS 客户端占位页](/configuration/shared/tls-client)。
* 必填：可选。
* 默认：明文 HTTP。
* 限制：显式 TLS 只在 Linux 上可用。

### username

* 类型：字符串。
* 必填：可选。

### password

* 类型：字符串。
* 必填：可选。
* 行为：有用户名时作为密码，没有时视为空。

## 说明

HTTP 代理没有原生 UDP，默认使用 `over-tcp`，也可显式写 `xudp` 或 `off`。`transport` 可以再套受支持的 stream transport。

## 相关

* [出站总览](/configuration/outbound/)
* [共享 TLS 客户端](/configuration/shared/tls-client)
* [共享 UDP](/configuration/shared/udp)
