Flutter iPhone http端口随机分配 [英] Flutter iPhone http port assigned randomly

查看:128
本文介绍了Flutter iPhone http端口随机分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过来自iPhone中flutter应用程序的http请求连接到本地服务器.

I am trying to connect to local server with http request from flutter app in iPhone.

我有这个错误

SocketException: OS Error: Operation timed out, errno = 60, address = IPfromMyMachine, port = 65353

从网上看到了很多解决方案,这些解决方案是修复anroid而不是iOS.任何人都可以帮忙吗?

Saw a lot of solution from online which is to fix anroid but not iOS. Anyone can help with this?

推荐答案

我通过将本地ip分配给DNS记录来解决了这个问题.

I solved this issue by assigning the local ip to a DNS record.

例如local.your_domain.com指向192.168.1.10

e.g local.your_domain.com points to 192.168.1.10

然后用网址替换IP地址,它应该可以正常工作

Then replace the IP address with the url and it should work fine

这篇关于Flutter iPhone http端口随机分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆