问题描述
我有一个用作后台服务的程序。它托管一个自托管服务。但是有一个问题。当我托管此服务时,它可用于所有区域设置网络。而且,同一网络中的每个人都可以访问此API。 这是我托管服务的方式:
首先,我向netsh注册该网址
_launchMaps(double lat,double lon) async {
String googleUrl =
'comgooglemaps://?center=${lat},${lon}';
String appleUrl =
'https://www.google.com/maps/search/?api=1&query=$lat,$lon';
if (await canLaunch("comgooglemaps://")) {
print('launching com googleUrl');
await launch(googleUrl);
} else if (await canLaunch(appleUrl)) {
print('launching apple url');
await launch(appleUrl);
} else {
throw 'Could not launch url';
}
}
然后我托管服务
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlechromes</string>
<string>comgooglemaps</string>
</array>
ExtendHttpSelfHostConfiguration 的结构为:
Android
它完全适用于本地计算机。
但是当我扫描网络时,nmap可以检测到该端口。
问题在于如何使其仅在计算机上工作。其他人不应访问此端口。 据我了解,这样做应该 0.0.0.0 ,而不是 127.0.0.1 。
我该如何解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)