Skip to content

Enabling Network Access

When you want to open your local project from another device (for example, by scanning a QR code in Fynx),
your development server must be started with network access enabled.

By default, many dev servers only listen to localhost, meaning they can’t be reached by other devices on the same Wi-Fi network.

This guide shows how to enable network access for popular development environments.


⚡ Vite

In your package.json scripts, add the --host flag:

json
{
  "scripts": {
    "dev": "vite --host"
  }
}

Then run:

bash
npm run dev

This makes your Vite app available at your computer’s local IP address (e.g. http://192.168.1.10:5173).


⚙️ Laravel (PHP Artisan)

When running your Laravel development server, use the --host option:

bash
php artisan serve --host=0.0.0.0 --port=8000

Now it will accept connections from any device in the same network. Access it on your phone or tablet at:

http://<your-local-ip>:8000

🧩 React (Create React App)

React’s built-in dev server can also be exposed with a HOST environment variable:

Windows (PowerShell)

bash
$env:HOST="0.0.0.0"; npm start

macOS/Linux

bash
HOST=0.0.0.0 npm start

🧠 Next.js

Next.js uses the same underlying dev server as Vite/CRA. Run it with the --hostname flag:

bash
next dev --hostname 0.0.0.0

You can also edit your package.json:

json
{
  "scripts": {
    "dev": "next dev --hostname 0.0.0.0"
  }
}

🧱 Node / Express

If you start your server like this:

js
app.listen(3000, 'localhost');

Change it to:

js
app.listen(3000, '0.0.0.0');

This makes your server reachable on your LAN IP address.


🧪 Flask (Python)

Run your Flask app with:

bash
flask run --host=0.0.0.0 --port=5000

Or if you start it manually:

python
app.run(host='0.0.0.0', port=5000)

🐳 Docker

If your project runs inside Docker, expose the port in your docker run command or docker-compose.yml.

Example:

bash
docker run -p 5173:5173 my-app

This maps the internal container port to your host machine’s IP, so Fynx can access it through your computer’s local network address.


🧭 Find Your Local IP

To connect from another device, you’ll need your computer’s local IP address.

Windows

bash
ipconfig

Look for IPv4 Address.

macOS/Linux

bash
ifconfig | grep inet

The IP will look like 192.168.x.x.


✅ Once your server is started with --host or 0.0.0.0, and both devices share the same Wi-Fi network, Fynx’s QR code will work instantly.

Released under the MIT License.