mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2025-01-19 17:21:41 +03:00
splithttp
This commit is contained in:
parent
1e94283a5b
commit
bcf02a8099
@ -68,7 +68,8 @@ export const sidebarEn: SidebarConfig = {
|
|||||||
'/en/config/transports/quic.md',
|
'/en/config/transports/quic.md',
|
||||||
'/en/config/transports/tcp.md',
|
'/en/config/transports/tcp.md',
|
||||||
'/en/config/transports/websocket.md',
|
'/en/config/transports/websocket.md',
|
||||||
'/en/config/transports/httpupgrade.md'
|
'/en/config/transports/httpupgrade.md',
|
||||||
|
'/en/config/transports/splithttp.md'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -69,7 +69,8 @@ export const sidebarZh: SidebarConfig = {
|
|||||||
'/config/transports/quic.md',
|
'/config/transports/quic.md',
|
||||||
'/config/transports/tcp.md',
|
'/config/transports/tcp.md',
|
||||||
'/config/transports/websocket.md',
|
'/config/transports/websocket.md',
|
||||||
'/config/transports/httpupgrade.md'
|
'/config/transports/httpupgrade.md',
|
||||||
|
'/config/transports/splithttp.md'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -63,6 +63,10 @@
|
|||||||
|
|
||||||
针对 HTTPUpragde 连接的配置。
|
针对 HTTPUpragde 连接的配置。
|
||||||
|
|
||||||
|
> `splithttpSettings`: [SplitHttpObject](./transports/splithttp.md)
|
||||||
|
|
||||||
|
针对 SplitHTTP 连接的配置。
|
||||||
|
|
||||||
> `dsSettings`: [DomainSocketObject](./transports/domainsocket.md)
|
> `dsSettings`: [DomainSocketObject](./transports/domainsocket.md)
|
||||||
|
|
||||||
针对 Domain Socket 连接的配置。
|
针对 Domain Socket 连接的配置。
|
||||||
|
56
docs/config/transports/splithttp.md
Normal file
56
docs/config/transports/splithttp.md
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# SplitHTTP
|
||||||
|
|
||||||
|
::: tip
|
||||||
|
Help me I don't know chinese.
|
||||||
|
:::
|
||||||
|
|
||||||
|
Uses HTTP chunked-transfer encoding for download, and multiple HTTP requests for upload.
|
||||||
|
|
||||||
|
Can be deployed on CDNs that do not support WebSocket, but there are still some requirements:
|
||||||
|
|
||||||
|
- The CDN must support HTTP chunked transfer encoding in a streaming fashion,
|
||||||
|
no response buffering. The transport will send the `X-Accel-Buffering: no`
|
||||||
|
response header, but only some CDNs respect this.
|
||||||
|
|
||||||
|
If the connection hangs, most likely this part does not work.
|
||||||
|
|
||||||
|
- The CDN must disable caching, or caching should include the query string in cache key.
|
||||||
|
|
||||||
|
Download performance should be similar to WebSocket, but upload is limited.
|
||||||
|
|
||||||
|
Like WebSocket transport, SplitHTTP parses the `X-Forwarded-For` header for logging.
|
||||||
|
|
||||||
|
## SplitHttpObject
|
||||||
|
|
||||||
|
The `SplitHttpObject` corresponds to the `splithttpSettings` section under transport configurations.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"host": "xray.com",
|
||||||
|
"headers": {
|
||||||
|
"key": "value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> `path`: string
|
||||||
|
|
||||||
|
HTTP path used by the connection. Defaults to `"/"`.
|
||||||
|
|
||||||
|
> `host`: string
|
||||||
|
|
||||||
|
HTTP Host sent by the connection. Empty by default. If this value is empty on the server, the host header sent by clients will not be validated.
|
||||||
|
|
||||||
|
If the `Host` header has been defined on the server in any way, the server will validate if the `Host` header matches.
|
||||||
|
|
||||||
|
The current priority of the `Host` header sent by clients: `host` > `headers` > `address`
|
||||||
|
|
||||||
|
> `headers`: map \{string: string\}
|
||||||
|
|
||||||
|
Customized HTTP headers defined in key-value pairs. Defaults to empty.
|
||||||
|
|
||||||
|
## Known issues
|
||||||
|
|
||||||
|
ALPN negotiation is currently not correctly implemented. HTTPS connections
|
||||||
|
always assume HTTP/2 prior knowledge.
|
@ -27,6 +27,7 @@ The `TransportObject` corresponds to the `transport` property in the config root
|
|||||||
"dsSettings": {},
|
"dsSettings": {},
|
||||||
"grpcSettings": {},
|
"grpcSettings": {},
|
||||||
"httpupgradeSettings": {}
|
"httpupgradeSettings": {}
|
||||||
|
"splithttpSettings": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -63,6 +64,10 @@ Configures HTTPUpgrade connections.
|
|||||||
|
|
||||||
Configures Domain Socket connections.
|
Configures Domain Socket connections.
|
||||||
|
|
||||||
|
> `splithttpSettings`: [SplitHttpObject](./transports/splithttp.md)
|
||||||
|
|
||||||
|
Configures SplitHTTP connections.
|
||||||
|
|
||||||
## StreamSettingsObject
|
## StreamSettingsObject
|
||||||
|
|
||||||
`StreamSettingsObject` corresponds to the `streamSettings` property in the inbound or outbound config. Each inbound or outbound can be configured with different transports and can use `streamSettings` to specify local configs.
|
`StreamSettingsObject` corresponds to the `streamSettings` property in the inbound or outbound config. Each inbound or outbound can be configured with different transports and can use `streamSettings` to specify local configs.
|
||||||
@ -80,6 +85,7 @@ Configures Domain Socket connections.
|
|||||||
"dsSettings": {},
|
"dsSettings": {},
|
||||||
"grpcSettings": {},
|
"grpcSettings": {},
|
||||||
"httpupgradeSettings": {},
|
"httpupgradeSettings": {},
|
||||||
|
"splithttpSettings": {},
|
||||||
"sockopt": {
|
"sockopt": {
|
||||||
"mark": 0,
|
"mark": 0,
|
||||||
"tcpMaxSeg": 1440,
|
"tcpMaxSeg": 1440,
|
||||||
@ -157,6 +163,10 @@ Configures the current Domain Socket connection. Valid only when Domain Socket i
|
|||||||
|
|
||||||
Configures the current HTTPUpragde connection. Valid only when HTTPUpgrade is used. Same schema as global.
|
Configures the current HTTPUpragde connection. Valid only when HTTPUpgrade is used. Same schema as global.
|
||||||
|
|
||||||
|
> `splithttpSettings`: [SplitHttpObject](./transports/splithttp.md)
|
||||||
|
|
||||||
|
Configures SplitHTTP connections. Valid only when SplitHTTP is used. Same schema as global.
|
||||||
|
|
||||||
> `sockopt`: [SockoptObject](#sockoptobject)
|
> `sockopt`: [SockoptObject](#sockoptobject)
|
||||||
|
|
||||||
Configures transparent proxies.
|
Configures transparent proxies.
|
||||||
|
52
docs/en/config/transports/splithttp.md
Normal file
52
docs/en/config/transports/splithttp.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# SplitHTTP
|
||||||
|
|
||||||
|
Uses HTTP chunked-transfer encoding for download, and multiple HTTP requests for upload.
|
||||||
|
|
||||||
|
Can be deployed on CDNs that do not support WebSocket, but there are still some requirements:
|
||||||
|
|
||||||
|
- The CDN must support HTTP chunked transfer encoding in a streaming fashion,
|
||||||
|
no response buffering. The transport will send the `X-Accel-Buffering: no`
|
||||||
|
response header, but only some CDNs respect this.
|
||||||
|
|
||||||
|
If the connection hangs, most likely this part does not work.
|
||||||
|
|
||||||
|
- The CDN must disable caching, or caching should include the query string in cache key.
|
||||||
|
|
||||||
|
Download performance should be similar to WebSocket, but upload is limited.
|
||||||
|
|
||||||
|
Like WebSocket transport, SplitHTTP parses the `X-Forwarded-For` header for logging.
|
||||||
|
|
||||||
|
## SplitHttpObject
|
||||||
|
|
||||||
|
The `SplitHttpObject` corresponds to the `splithttpSettings` section under transport configurations.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"path": "/",
|
||||||
|
"host": "xray.com",
|
||||||
|
"headers": {
|
||||||
|
"key": "value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> `path`: string
|
||||||
|
|
||||||
|
HTTP path used by the connection. Defaults to `"/"`.
|
||||||
|
|
||||||
|
> `host`: string
|
||||||
|
|
||||||
|
HTTP Host sent by the connection. Empty by default. If this value is empty on the server, the host header sent by clients will not be validated.
|
||||||
|
|
||||||
|
If the `Host` header has been defined on the server in any way, the server will validate if the `Host` header matches.
|
||||||
|
|
||||||
|
The current priority of the `Host` header sent by clients: `host` > `headers` > `address`
|
||||||
|
|
||||||
|
> `headers`: map \{string: string\}
|
||||||
|
|
||||||
|
Customized HTTP headers defined in key-value pairs. Defaults to empty.
|
||||||
|
|
||||||
|
## Known issues
|
||||||
|
|
||||||
|
ALPN negotiation is currently not correctly implemented. HTTPS connections
|
||||||
|
always assume HTTP/2 prior knowledge.
|
Loading…
x
Reference in New Issue
Block a user