指定备选服务器
alt
参数的格式由 RFC 7838 严格定义为 ASCII 字符串,其中包含与特定主机和端口相关联的"替代"协议的逗号分隔列表。
例如,值 'h2="example.org:81"'
表示 HTTP/2 协议在主机 'example.org'
上的 TCP/IP 端口 81 上可用。
主机和端口必须包含在引号 ("
) 字符内。
可以指定多个备选方案,例如:'h2="example.org:81", h2=":82"'
。
协议标识符(示例中的 'h2'
)可以是任何有效的 ALPN 协议 ID。
这些值的语法未经 Node.js 实现验证,而是按照用户提供的或从对等方接收的方式传入。
The format of the alt
parameter is strictly defined by RFC 7838 as an
ASCII string containing a comma-delimited list of "alternative" protocols
associated with a specific host and port.
For example, the value 'h2="example.org:81"'
indicates that the HTTP/2
protocol is available on the host 'example.org'
on TCP/IP port 81. The
host and port must be contained within the quote ("
) characters.
Multiple alternatives may be specified, for instance: 'h2="example.org:81", h2=":82"'
.
The protocol identifier ('h2'
in the examples) may be any valid
ALPN Protocol ID.
The syntax of these values is not validated by the Node.js implementation and are passed through as provided by the user or received from the peer.