指定替代服务


¥Specifying alternative services

alt 参数的格式由 RFC 7838 严格定义为一个 ASCII 字符串,其中包含与特定主机和端口关联的以逗号分隔的 "alternative" 协议列表。

¥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.

例如,值 'h2="example.org:81"' 表示 HTTP/2 协议在主机 'example.org' 上的 TCP/IP 端口 81 上可用。主机和端口必须包含在引号 (") 字符中。

¥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.

可以指定多个备选方案,例如:'h2="example.org:81", h2=":82"'

¥Multiple alternatives may be specified, for instance: 'h2="example.org:81", h2=":82"'.

协议标识符(示例中的 'h2')可以是任何有效的 ALPN 协议 ID

¥The protocol identifier ('h2' in the examples) may be any valid ALPN Protocol ID.

这些值的语法未经 Node.js 实现验证,而是按照用户提供的或从对等方接收的方式传入。

¥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.