指定替代服务


🌐 Specifying alternative services

alt 参数的格式由 RFC 7838 严格规定,为一个 ASCII 字符串,包含与特定主机和端口相关的“备用”协议的逗号分隔列表。

🌐 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 协议标识

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