Home > front end >  How To Access Flutter Run Web Server From My Phone
How To Access Flutter Run Web Server From My Phone

Time:01-19

I can create a Localhost Trough This Command :-

flutter run --release -d web-server --web-hostname=0.0.0.0 --web-port=3000

But it's only available on my laptop,

How can i get that output in my other devices connected to that same network..

CodePudding user response:

In order to access the web server running on your laptop from other devices on the same network, you will need to find the IP address of your laptop and use that instead of "localhost" or "0.0.0.0". The IP address can typically be found by running the command "ipconfig" on Windows or "ifconfig" on Mac/Linux. Once you have the IP address, you can enter it in the form of "http://[IP_ADDRESS]:3000" in the web browser of the other device and it should connect to the web server running on your laptop.

CodePudding user response:

When you run the command

flutter run --release -d web-server --web-hostname=0.0.0.0 --web-port=3000

It starts a web server on your laptop and binds it to the IP address 0.0.0.0 and port 3000. This means that the server will be available on all network interfaces on your laptop and can be accessed from other devices connected to the same network using the IP address of your laptop and the port 3000.

To access the server from your phone, you need to find the IP address of your laptop and use it in the URL. You can find the IP address of your laptop by running the command ipconfig (Windows) or ifconfig (macOS or Linux) in the terminal.

Once you have the IP address of your laptop, you can access the server from your phone by navigating to http://:3000 in the browser of your phone.

Please note that, the IP address of your laptop should be in the same network as your phone. Also, You may need to configure your router to forward incoming traffic on port 3000 to your laptop, as some routers block incoming traffic on certain ports by default.

  • Related