/// The [address] can either be a [String] or an
/// [InternetAddress]. If [address] is a [String], [bind] will
/// perform a [InternetAddress.lookup] and use the first value in the
/// list. To listen on the loopback adapter, which will allow only
/// incoming connections from the local host, use the value
/// [InternetAddress.loopbackIPv4] or
/// [InternetAddress.loopbackIPv6]. To allow for incoming
/// connection from the network use either one of the values
/// [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
/// bind to all interfaces or the IP address of a specific interface.
1条答案
按热度按时间2nbm6dog1#
无论在哪里调用
serve
,第二个参数似乎可以是各种各样的东西,包括'0.0.0.0':https://pub.dev/documentation/dart_frog/latest/dart_frog/serve.html。向下搜索,我们最终找到的地址为:看起来你想要
InternetAddress.anyIPv4
作为你的值。