Add NSURLSession http client engine

This commit is contained in:
世界
2026-04-14 00:14:05 +08:00
parent ccfdbf2d57
commit 334dd6e5c0
42 changed files with 3331 additions and 1057 deletions

View File

@@ -14,6 +14,7 @@ When object:
```json
{
"engine": "",
"version": 0,
"disable_version_fallback": false,
"headers": {},
@@ -28,6 +29,50 @@ When object:
### Fields
#### engine
HTTP engine to use.
Values:
* `go` (default)
* `apple`
`apple` uses NSURLSession, only available on Apple platforms.
!!! warning ""
Experimental only: due to the high memory overhead of both CGO and Network.framework,
do not use in hot paths on iOS and tvOS.
Supported fields:
* `headers`
* `tls.server_name` (must match request host)
* `tls.insecure`
* `tls.min_version` / `tls.max_version`
* `tls.certificate` / `tls.certificate_path`
* `tls.certificate_public_key_sha256`
* Dial Fields
Unsupported fields:
* `version`
* `disable_version_fallback`
* HTTP2 Fields
* QUIC Fields
* `tls.engine`
* `tls.alpn`
* `tls.disable_sni`
* `tls.cipher_suites`
* `tls.curve_preferences`
* `tls.client_certificate` / `tls.client_certificate_path` / `tls.client_key` / `tls.client_key_path`
* `tls.fragment` / `tls.record_fragment`
* `tls.kernel_tx` / `tls.kernel_rx`
* `tls.ech`
* `tls.utls`
* `tls.reality`
#### version
HTTP version.

View File

@@ -14,6 +14,7 @@ icon: material/new-box
```json
{
"engine": "",
"version": 0,
"disable_version_fallback": false,
"headers": {},
@@ -28,6 +29,50 @@ icon: material/new-box
### 字段
#### engine
要使用的 HTTP 引擎。
可用值:
* `go`(默认)
* `apple`
`apple` 使用 NSURLSession仅在 Apple 平台可用。
!!! warning ""
仅供实验用途:由于 CGO 和 Network.framework 占用的内存都很多,
不应在 iOS 和 tvOS 的热路径中使用。
支持的字段:
* `headers`
* `tls.server_name`(必须与请求主机匹配)
* `tls.insecure`
* `tls.min_version` / `tls.max_version`
* `tls.certificate` / `tls.certificate_path`
* `tls.certificate_public_key_sha256`
* 拨号字段
不支持的字段:
* `version`
* `disable_version_fallback`
* HTTP2 字段
* QUIC 字段
* `tls.engine`
* `tls.alpn`
* `tls.disable_sni`
* `tls.cipher_suites`
* `tls.curve_preferences`
* `tls.client_certificate` / `tls.client_certificate_path` / `tls.client_key` / `tls.client_key_path`
* `tls.fragment` / `tls.record_fragment`
* `tls.kernel_tx` / `tls.kernel_rx`
* `tls.ech`
* `tls.utls`
* `tls.reality`
#### version
HTTP 版本。

View File

@@ -197,7 +197,7 @@ TLS engine to use.
Values:
* `go`
* `go` (default)
* `apple`
`apple` uses Network.framework, only available on Apple platforms and only supports **direct** TCP TLS client connections.
@@ -205,7 +205,7 @@ Values:
!!! warning ""
Experimental only: due to the high memory overhead of both CGO and Network.framework,
do not use in proxy paths on iOS and tvOS.
do not use in hot paths on iOS and tvOS.
If you want to circumvent TLS fingerprint-based proxy censorship,
use [NaiveProxy](/configuration/outbound/naive/) instead.

View File

@@ -197,7 +197,7 @@ TLS 版本值:
可用值:
* `go`
* `go`(默认)
* `apple`
`apple` 使用 Network.framework仅在 Apple 平台可用,且仅支持 **直接** TCP TLS 客户端连接。
@@ -205,7 +205,7 @@ TLS 版本值:
!!! warning ""
仅供实验用途:由于 CGO 和 Network.framework 占用的内存都很多,
不应在 iOS 和 tvOS 的代理路径中使用。
不应在 iOS 和 tvOS 的路径中使用。
如果您想规避基于 TLS 指纹的代理审查,应使用 [NaiveProxy](/zh/configuration/outbound/naive/)。
支持的字段: