mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2025-01-19 09:11:40 +03:00
Add HTTPUpgrade Transport (#482)
This commit is contained in:
parent
1dfc8e45d2
commit
046bae2cb5
@ -68,6 +68,7 @@ export const sidebarZh: SidebarConfig = {
|
||||
'/config/transports/quic.md',
|
||||
'/config/transports/tcp.md',
|
||||
'/config/transports/websocket.md',
|
||||
'/config/transports/httpupgrade.md'
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@ -1,4 +1,4 @@
|
||||
# metrics
|
||||
# Metrics
|
||||
|
||||
更直接(希望更好)的统计导出方式。
|
||||
|
||||
|
@ -25,7 +25,8 @@
|
||||
"httpSettings": {},
|
||||
"quicSettings": {},
|
||||
"dsSettings": {},
|
||||
"grpcSettings": {}
|
||||
"grpcSettings": {},
|
||||
"httpupgradeSettings": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -54,6 +55,10 @@
|
||||
|
||||
针对 gRPC 连接的配置。
|
||||
|
||||
> `httpupgradeSettings`: [HttpUpgradeObject](./transports/httpupgrade.md)
|
||||
|
||||
针对 HTTPUpragde 连接的配置。
|
||||
|
||||
> `dsSettings`: [DomainSocketObject](./transports/domainsocket.md)
|
||||
|
||||
针对 Domain Socket 连接的配置。
|
||||
@ -74,6 +79,7 @@
|
||||
"quicSettings": {},
|
||||
"dsSettings": {},
|
||||
"grpcSettings": {},
|
||||
"httpupgradeSettings": {},
|
||||
"sockopt": {
|
||||
"mark": 0,
|
||||
"tcpMaxSeg": 1440,
|
||||
@ -152,6 +158,11 @@ Reality 是目前最安全的传输加密方案, 且外部看来流量类型和
|
||||
|
||||
当前连接的 Domain socket 配置,仅当此连接使用 Domain socket 时有效。配置内容与上面的全局配置相同。
|
||||
|
||||
> `httpupgradeSettings`: [HttpUpgradeObject](./transports/httpupgrade.md)
|
||||
|
||||
当前连接的 HTTPUpragde 配置,仅当此连接使用 HTTPUpragde 时有效。配置内容与上面的全局配置相同。
|
||||
|
||||
|
||||
> `sockopt`: [SockoptObject](#sockoptobject)
|
||||
|
||||
透明代理相关的具体配置。
|
||||
|
34
docs/config/transports/httpupgrade.md
Normal file
34
docs/config/transports/httpupgrade.md
Normal file
@ -0,0 +1,34 @@
|
||||
# HttpUpgrade
|
||||
|
||||
一个实现了类似于 WebSocket 进行 HTTP 1.1 升级请求和响应的协议,这使得它可以像 WebSocket 一样可以被CDN或者Nginx进行反代,但无需实现 WebSocket 协议的其他部分,所以具有更高的效率。
|
||||
其设计不推荐单独使用,而是和TLS等安全协议一起工作。
|
||||
|
||||
## HttpUpgradeObject
|
||||
|
||||
`HttpUpgradeObject` 对应传输配置的 `httpupgradeSettings` 项。
|
||||
|
||||
```json
|
||||
{
|
||||
"acceptProxyProtocol": false,
|
||||
"path": "/",
|
||||
"host": "xray.com"
|
||||
}
|
||||
```
|
||||
|
||||
> `acceptProxyProtocol`: true | false
|
||||
|
||||
仅用于 inbound,指示是否接收 PROXY protocol。
|
||||
|
||||
[PROXY protocol](https://www.haproxy.org/download/2.2/doc/proxy-protocol.txt) 专用于传递请求的真实来源 IP 和端口,**若你不了解它,请先忽略该项**。
|
||||
|
||||
常见的反代软件(如 HAProxy、Nginx)都可以配置发送它,VLESS fallbacks xver 也可以发送它。
|
||||
|
||||
填写 `true` 时,最底层 TCP 连接建立后,请求方必须先发送 PROXY protocol v1 或 v2,否则连接会被关闭。
|
||||
|
||||
> `path`: string
|
||||
|
||||
HTTPUpgrade 所使用的 HTTP 协议路径,默认值为 `"/"`。
|
||||
|
||||
> `host`: string
|
||||
|
||||
HTTPUpgrade 的HTTP请求中所发送的Host,默认值为空。
|
Loading…
x
Reference in New Issue
Block a user