!!! question "自 sing-box 1.14.0 起"
字符串或对象。
当为字符串时,为顶层 http_clients 中定义的共享 HTTP 客户端 的标签。
当为对象时:
{
"engine": "",
"version": 0,
"disable_version_fallback": false,
"headers": {},
... // HTTP2 字段
"tls": {},
... // 拨号字段
}
要使用的 HTTP 引擎。
可用值:
go(默认)applecronetapple 使用 NSURLSession,仅在 Apple 平台可用。
!!! warning ""
仅供实验用途:由于 CGO 和 Network.framework 占用的内存都很多,
不应在 iOS 和 tvOS 的热路径中使用。
支持的字段:
headerstls.server_name(必须与请求主机匹配)tls.insecuretls.min_version / tls.max_versiontls.certificate / tls.certificate_pathtls.certificate_public_key_sha256不支持的字段:
versiondisable_version_fallbacktls.enginetls.alpntls.disable_snitls.cipher_suitestls.curve_preferencestls.client_certificate / tls.client_certificate_path / tls.client_key / tls.client_key_pathtls.fragment / tls.record_fragmenttls.kernel_tx / tls.kernel_rxtls.echtls.utlstls.realitycronet 使用 Cronet,仅在 sing-box 使用 with_naive_outbound 标签构建时可用。
支持的字段:
versiondisable_version_fallback(仅 version = 3)headerstls.server_name(必须与请求主机匹配)tls.certificate / tls.certificate_pathtls.certificate_public_key_sha256tls.ech.config / tls.ech.config_path / tls.ech.query_server_namehttp2.stream_receive_window / http2.connection_receive_windowquic.stream_receive_window / quic.connection_receive_windowquic.idle_timeout不支持的字段:
tls.enginetls.disable_snitls.insecuretls.alpntls.min_version / tls.max_versiontls.cipher_suitestls.curve_preferencestls.client_certificate / tls.client_certificate_path / tls.client_key / tls.client_key_pathtls.fragment / tls.record_fragmenttls.kernel_tx / tls.kernel_rxtls.handshake_timeouttls.utlstls.realityhttp2.idle_timeouthttp2.keep_alive_periodhttp2.max_concurrent_streamsquic.keep_alive_periodquic.initial_packet_sizequic.disable_path_mtu_discoveryquic.max_concurrent_streamsHTTP 版本。
可用值:1、2、3。
默认使用 2。
禁用自动回退到更低的 HTTP 版本。
自定义 HTTP 标头。
Host 标头用作请求主机。
当 version 为 2(默认)时。
参阅 HTTP2 字段 了解详情。
当 version 为 3 时。
参阅 QUIC 字段 了解详情。
参阅 TLS 了解详情。
参阅 拨号字段 了解详情。