如何更改Flutter Web应用程序的默认Web服务器IP(127.0.0.1) [英] How to change the default web server ip(127.0.0.1) of Flutter Web app
问题描述
更改Flutter Web App的默认IP(127.0.0.1).
Change the default IP(127.0.0.1) of flutter web App.
我创建了一个Flutter Web应用程序,当我运行Web应用程序时,分配的ip是127.0.0.1,但是我无法使用本地IP over LAN访问同一应用程序.因此,请提供有关如何更改此设置的帮助.
I have created a flutter web application, when I run the web app the ip which assigned is 127.0.0.1 but i am unable to access the same app with my local IP over LAN. So please help on how can i change this.
推荐答案
更新
webdev
不再用于启动flutter web
应用程序.现在使用:
webdev
is no longer used for launching flutter web
applications. Now use:
flutter run -d web-server --web-hostname 0.0.0.0 --web-port 8989
原始答案
使用以下命令启动应用程序:
Start the app with command:
webdev服务器--web主机名0.0.0.0
webdev server --web-hostname 0.0.0.0
或将0.0.0.0替换为您的实际IP地址.
Or replace 0.0.0.0 with your actual ip address.
这篇关于如何更改Flutter Web应用程序的默认Web服务器IP(127.0.0.1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!