sessionOptions.preferredAddressPolicy
- 类型:<string>
'use'、'ignore'或'default'之一。 - 默认:
'ignore'
当远程端点通告首选地址时,此选项指定是否使用它或忽略它。默认值是 'ignore',因为遵守服务器的首选地址会导致客户端将连接迁移到不同的 IP 地址,这可能被利用进行数据外泄攻击,而在网络层面上这些攻击与合法的 QUIC 连接迁移无法区分。只有在连接到需要首选地址迁移的可信服务器时,才设置为 'use'。
🌐 When the remote peer advertises a preferred address, this option specifies whether
to use it or ignore it. The default is 'ignore' because honoring a server's
preferred address causes the client to migrate its connection to a different IP
address, which can be exploited for data exfiltration attacks that are
indistinguishable from legitimate QUIC connection migration at the network level.
Set to 'use' only when connecting to trusted servers that require preferred
address migration.