简体   繁体   English

ionic 5/ Angular 8 - ios 无法连接到 local.network 服务器

[英]ionic 5/ Angular 8 - ios unable to connect to local network server

the iphone can connect to the testing server, however, with local.network providing the IP address 192.168.x.xx:3000 cannot connect with the error Failed to load resource: A server with the specified hostname could not be found. iphone 可以连接到测试服务器,但是,local.network 提供 IP 地址 192.168.x.xx:3000 无法连接,错误Failed to load resource: A server with the specified hostname could not be found. There is no problem with an Android device connecting but with iOS I receive the error above.连接 Android 设备没有问题,但使用 iOS 我收到上述错误。

Also, I have changed the DNS manually to what is suggested in other posts to 8.8.8.8 however the issue still remains the same.此外,我已将 DNS 手动更改为其他帖子中建议的8.8.8.8 ,但问题仍然存在。 thanks.谢谢。

I run the command: $ ionic cordova run ios --device我运行命令: $ ionic cordova run ios --device

this has something to with on which band you're connected to your wifi.这与您连接到 wifi 的频段有关。 You can resolve this by connecting to the 2.4Ghz band and not the 5Ghz.您可以通过连接到 2.4Ghz 频段而不是 5Ghz 来解决此问题。 I still don't know why but it only happens with iOS devices.我仍然不知道为什么,但它只发生在 iOS 设备上。 MacOS is all fine. MacOS 一切正常。

I found the answer here .我在这里找到了答案。 I still yet to find out the reason, though.不过,我仍然没有找出原因。

I'm also building an ionic app when I encountered this but the same is true for vue3 and python.当我遇到这个问题时,我也在构建一个 ionic 应用程序,但 vue3 和 python 也是如此。

I have a similar situation and the problem was the windows firewall.我有类似的情况,问题是 windows 防火墙。

Configuring my app to communicate through the Windows Defender Firewall over Public at Allowed Applications solved my problem.将我的应用程序配置为通过 Windows Defender 防火墙在Allowed ApplicationsPublic通信解决了我的问题。

View a print at this answer here此处查看此答案的打印件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM