Inspecting my local projects on mobile
Getting local DDEV projects on my phone, with a Vite dev server running, and without sharing on the internet.
Contents
The problem #
When developing locally, you'll probably want to check your templates look right on a small mobile screen. While dev-tools emulation is a quick way to test all kinds of viewports, it can't capture the whole mobile UX, like the browser chrome appearing and disappearing on scroll, the keyboard sliding up and down and so forth. Furthermore, testing on a real phone gives a different, more tactile experience and helps catch bugs that are particular to mobile browsers.
What I used to use #
For several years my need for local mobile testing was covered by a little app called Prepros. Prepros has a nice UI and does lots more than just opening your project to your local network. Indeed, I was using it for serving my files, live reloading, mobile testing, compiling, bundling etc. It served me well and I was more than happy to pay the reasonable price asked for a lifetime license.
In recent years though I gravitated towards popular open source CLI tooling like DDEV, Vite and the like. At the same time I moved my toolchain into WSL2. This left me in a place where I had to keep Prepros just to be able to inspect my projects on mobile. It kinda worked, but it felt awkward, it required workarounds for WSL, and I still wasn't able to get it to work with the Vite dev server.
So what was I to do?
How about ddev share? #
It works, but it puts my half-finished site on the internet, which I don't like. I'm weird like that. Most days I just want to see whether a menu falls apart on the phone lying next to my keyboard. The phone is right there. It shouldn't need the internet to look at my desk.
And, most importantly, this still doesn't cover the Vite dev server! Argh! You'd think we'd have covered the basics for modern web dev in the year 2026!
The solution #
I work on Windows with WSL2 and DDEV, mostly on Craft CMS and now and then a WordPress Bedrock site, so that's what this article covers.
A high-level view of what we're trying to achieve looks something like this:
phone → Windows 0.0.0.0:8081 (port forward) → 127.0.0.1:<web port> → WSL → DDEV → nginx → Craft / WordPress
→ Vite :3000Let's get on with it then!
Part 1: One-time machine prep #
Open PowerShell as admin and run these two:
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8081 connectaddress=127.0.0.1 connectport=8080
New-NetFirewallRule -DisplayName "DDEV LAN 8081" -Direction Inbound -Protocol TCP -LocalPort 8081 -Action Allow -Profile Any -RemoteAddress LocalSubnet -Enabled FalseThe forward points at 127.0.0.1 rather than the WSL IP, because WSL already forwards localhost and its IP changes on every reboot, just to keep things interesting. The 8080 is a placeholder; the script below swaps in the right port. The firewall rule says -Profile Any because Windows has decided that my wired network is Public, which is a strange thing to say about a cable going into a box under my desk, and a rule for private networks quietly blocks the phone. LocalSubnet still keeps it to my own network. The rule starts out disabled, so nothing is reachable until you run ddev lan on.
Then save the ddev lan command as ~/.ddev/commands/host/lan and make it executable. qrencode is for the QR code, because life is too short to type IP addresses on a phone keyboard.
chmod +x ~/.ddev/commands/host/lan
sudo apt install qrencodeddev lan on # point the forward at this project, open the firewall, show a QR code
ddev lan off # close it again
ddev lan # status
ddev lan init # set up or check the current projectDDEV sometimes picks a new port after ddev restart, so run ddev lan on again after one. Plain ddev lan tells you when the ports don't match.
Part 2: A Craft project #
Back up .env first. Nothing here gets committed, apart from one small change to vite.config.ts that does nothing unless you ask it to.
URLs that follow the request host #
Craft's @web alias resolves to whatever host the page was opened on, so the site URLs in .env become:
SITE_EN_URL="@web/en"
SITE_NL_URL="@web/nl"
# a site at the root: "@web"ddev lan init tells you which lines to change. Check the names in config/project/sites/*.yaml and set every site's variable, or that site will 404. Console commands and queue jobs have no request to take a host from, so check any links they generate locally, emails especially. And leave host_webserver_port unset, so ddev lan on can follow whatever port DDEV picks.
Vite through the site's own host #
The phone can't reach Vite on port 3000, and it wouldn't trust the certificate on *.ddev.site:3000 anyway. So nginx hands Vite's paths over on the site's own host. That takes a flag, one line in .env and a small proxy config:
# .ddev/config.local.yaml
web_environment:
- VITE_SAME_ORIGIN=true# .env: leave VITE_DEV_SERVER_INTERNAL alone, so Craft falls back to the built assets when Vite isn't running
VITE_DEV_SERVER_PUBLIC="/"# .ddev/nginx/vite-proxy.conf
location ^~ /@vite/ { proxy_pass http://127.0.0.1:3000; include /mnt/ddev_config/nginx/vite-proxy.inc; }
location ^~ /@id/ { proxy_pass http://127.0.0.1:3000; include /mnt/ddev_config/nginx/vite-proxy.inc; }
location ^~ /@fs/ { proxy_pass http://127.0.0.1:3000; include /mnt/ddev_config/nginx/vite-proxy.inc; }
location ^~ /src/ { proxy_pass http://127.0.0.1:3000; include /mnt/ddev_config/nginx/vite-proxy.inc; }
location ^~ /node_modules/ { proxy_pass http://127.0.0.1:3000; include /mnt/ddev_config/nginx/vite-proxy.inc; }
location ^~ /__vite_hmr { proxy_pass http://127.0.0.1:3000; include /mnt/ddev_config/nginx/vite-proxy.inc; }
# .ddev/nginx/vite-proxy.inc: hot reload needs the websocket upgrade
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1h;/src/ is my source folder. Yours is whatever the second <script> tag on a dev page starts with. Keep the ^~, by the way. I first wrote these as regex locations, but DDEV's rule against dotfiles won, and /node_modules/.vite/ kept coming back as a 403. I stared at that for longer than I'd like to admit. The two nginx files go in .git/info/exclude, and ddev lan init writes all of this for you.
The one change that does get committed is in vite.config.ts, and it stays out of everyone's way unless the flag is set:
const sameOrigin = process.env.VITE_SAME_ORIGIN === "true";
export default defineConfig(() => ({
server: {
hmr: sameOrigin ? { path: "__vite_hmr" } : undefined,
origin: sameOrigin ? undefined : "http://localhost:3000", // your existing origin
},
}));Don't set clientPort. Without it, hot reload goes back to whatever port the page came from, which is exactly where it should go. Then ddev restart and start Vite.
Part 2B: A Bedrock project #
Bedrock is more stubborn. It reads WP_HOME and WP_SITEURL from .env and turns them into constants, and constants don't care which host you came from. What works is a small PHP file that sets both before Bedrock gets a say. Again, ddev lan init writes it:
<?php
// .ddev/php/lan-prepend.php: make WP_HOME/WP_SITEURL follow the request host
if (!empty($_SERVER['HTTP_HOST'])) {
$https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https';
$home = ($https ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
putenv("WP_HOME=$home");
putenv("WP_SITEURL=$home/wp");
}; .ddev/php/lan.ini
auto_prepend_file = /var/www/html/.ddev/php/lan-prepend.phpBedrock's Dotenv politely never overwrites a variable that's already set, so the prepend wins. ddev wp doesn't go through PHP-FPM and keeps the usual .ddev.site URL. Links saved into the database as full URLs will still point at the PC, though. No PHP file can save you from those.
Part 3: Who needs a part 3? #
ddev lan on, scan the code, and save a CSS file. The phone should update on its own, which is more satisfying than it has any right to be.
What if it doesn't work #
If the site opens on the PC at :8081 but not on the phone, it's the firewall: the rule is off, or it only allows private networks. If the phone can't connect at all, it's probably on the guest Wi-Fi, which exists precisely to stop this sort of thing, or you restarted DDEV and forgot ddev lan on. Pages without CSS usually mean a .ddev.site or :3000 URL is still hiding in .env. CSS but no hot reload means hmr.path and the nginx location don't match. And if Bedrock keeps loading assets from .ddev.site, lan.ini is missing or DDEV wasn't restarted.
The ddev lan command #
#!/bin/bash
## Description: Open or close the site to phones on the local network (Windows firewall rule "DDEV LAN 8081")
## Usage: lan [on|off|status|init]
## Example: ddev lan init
## Example: ddev lan on
## Example: ddev lan off
## Example: ddev lan
## CanRunGlobally: true
# Windows forwards 0.0.0.0:8081 to 127.0.0.1:<port> (netsh portproxy), and WSL forwards that to
# DDEV. "on" points the forward at the current project's web port (DDEV picks it, no fixed port
# needed) and enables the firewall rule. "off" only disables the rule. Both need admin rights
# (a UAC prompt). Run "on" from inside the project, after "ddev start".
RULE="DDEV LAN 8081"
PORT=8081
ps() {
powershell.exe -NoProfile -NonInteractive -Command "$1" 2>/dev/null | tr -d '\r'
}
# Runs a command in an elevated PowerShell; passed encoded so quotes survive
ps_admin() {
local encoded
encoded=$(printf '%s' "$1" | iconv -t UTF-16LE | base64 -w0)
ps "try { Start-Process powershell.exe -Verb RunAs -Wait -WindowStyle Hidden -ArgumentList '-NoProfile','-EncodedCommand','$encoded'; 'ok' } catch { 'cancelled' }"
}
# HTTP port DDEV published on the host for the current project
web_port() {
ddev describe -j 2>/dev/null | python3 -c "
import json, sys
try:
web = json.load(sys.stdin)['raw']['services']['web']
print(next(m['host_port'] for m in web['host_ports_mapping'] if m['exposed_port'] == '80'))
except Exception:
pass"
}
# Port the Windows forward currently points at
forward_port() {
ps "netsh interface portproxy show v4tov4" | awk -v p="$PORT" '$1 == "0.0.0.0" && $2 == p { print $4 }'
}
# Bedrock: writes the local-only PHP files that make WP_HOME/WP_SITEURL follow the request host
init_bedrock() {
local root="$1"
mkdir -p "$root/.ddev/php"
cat > "$root/.ddev/php/lan-prepend.php" <<'PHP'
<?php
// Local only: make Bedrock's WP_HOME/WP_SITEURL follow the request host (LAN sharing, ddev share).
// Runs before config/application.php; Dotenv is immutable, so these win over .env/.env.local.
if (!empty($_SERVER['HTTP_HOST'])) {
$https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https';
$home = ($https ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
putenv("WP_HOME=$home");
putenv("WP_SITEURL=$home/wp");
}
PHP
printf '; Local only\nauto_prepend_file = /var/www/html/.ddev/php/lan-prepend.php\n' > "$root/.ddev/php/lan.ini"
# Keep both out of git (the folder also holds tracked files such as xdebug.ini)
local exclude="$root/.git/info/exclude"
if [ -d "$root/.git" ]; then
mkdir -p "$root/.git/info"
grep -qxF '.ddev/php/lan.ini' "$exclude" 2>/dev/null || \
printf '# Local LAN sharing\n.ddev/php/lan.ini\n.ddev/php/lan-prepend.php\n' >> "$exclude"
fi
echo "Bedrock project: wrote .ddev/php/lan.ini and .ddev/php/lan-prepend.php"
echo "Next: ddev restart, then ddev lan on"
}
# Vite: serves the dev server through the site's own host, so a phone on the LAN gets the dev assets
# and hot reload. Writes the local nginx proxy and the flag; the tracked files are reported, not edited.
init_vite() {
local root="$1" craft_dir="$2" pkg dir cfg src port
pkg=$(cd "$root" && find . -maxdepth 3 -name package.json -not -path '*/node_modules/*' -not -path '*/vendor/*' 2>/dev/null \
| sort | xargs grep -l '"vite"' 2>/dev/null | head -n1)
pkg=${pkg#./}
[ -n "$pkg" ] || return 0
local pkg_dir
pkg_dir=$(dirname "$pkg")
dir="$root/$pkg_dir"; [ "$pkg_dir" = "." ] && dir="$root"
cfg=$(ls "$dir"/vite.config.{ts,mts,js,mjs} 2>/dev/null | head -n1)
if [ -z "$cfg" ]; then
echo "Vite: $pkg found but no vite.config.* next to it; skipped"
return 0
fi
# Source folder(s) from rollupOptions.input (first path segment)
src=$(python3 - "$cfg" <<'PY'
import re, sys
text = open(sys.argv[1]).read()
m = re.search(r"\binput\s*:\s*", text)
folders = []
if m:
rest = text[m.end():]
if rest[0] == "{":
depth, end = 0, 0
for i, ch in enumerate(rest):
depth += (ch == "{") - (ch == "}")
if depth == 0:
end = i
break
rest = rest[:end + 1]
else:
rest = rest.split("\n", 1)[0]
for s in re.findall(r"['\"]([^'\"]+)['\"]", rest):
s = re.sub(r"^(\./)+", "", s)
if "/" in s and not s.startswith(("..", "/")) and s.split("/")[0] not in folders:
folders.append(s.split("/")[0])
print(" ".join(folders) or "src")
PY
)
port=$(grep -oE '\bport:[[:space:]]*[0-9]+' "$cfg" | head -n1 | grep -oE '[0-9]+')
port=${port:-5173}
mkdir -p "$root/.ddev/nginx"
{
echo "# Local only: serves the Vite dev server on the site's own host, so a phone on the LAN gets"
echo "# the dev assets and HMR too. Needs VITE_SAME_ORIGIN=true and VITE_DEV_SERVER_PUBLIC=\"/\"."
echo "# ^~ keeps nginx's dotfile rule from blocking /node_modules/.vite/"
local p f paths=(/@vite/ /@id/ /@fs/ /@vite-plugin-checker-runtime)
for f in $src; do paths+=("/$f/"); done
paths+=(/node_modules/ /__vite_hmr)
for p in "${paths[@]}"; do
echo "location ^~ $p { proxy_pass http://127.0.0.1:$port; include /mnt/ddev_config/nginx/vite-proxy.inc; }"
done
} > "$root/.ddev/nginx/vite-proxy.conf"
cat > "$root/.ddev/nginx/vite-proxy.inc" <<'INC'
# Shared by the locations in vite-proxy.conf; HMR needs the websocket upgrade
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1h;
INC
# VITE_SAME_ORIGIN flag in .ddev/config.local.yaml (gitignored by DDEV)
local local_cfg="$root/.ddev/config.local.yaml"
if [ ! -f "$local_cfg" ]; then
printf 'web_environment:\n - VITE_SAME_ORIGIN=true\n' > "$local_cfg"
elif ! grep -q 'VITE_SAME_ORIGIN' "$local_cfg"; then
if grep -q '^web_environment:' "$local_cfg"; then
sed -i '/^web_environment:/a\ - VITE_SAME_ORIGIN=true' "$local_cfg"
else
printf 'web_environment:\n - VITE_SAME_ORIGIN=true\n' >> "$local_cfg"
fi
fi
if [ -d "$root/.git" ] && ! grep -qxF '.ddev/nginx/vite-proxy.conf' "$root/.git/info/exclude" 2>/dev/null; then
mkdir -p "$root/.git/info"
printf '# Local Vite LAN proxy\n.ddev/nginx/vite-proxy.conf\n.ddev/nginx/vite-proxy.inc\n' >> "$root/.git/info/exclude"
fi
echo "Vite: $pkg"
echo " wrote .ddev/nginx/vite-proxy.conf (source folder(s): $src, port: $port) and vite-proxy.inc"
echo " set VITE_SAME_ORIGIN=true in .ddev/config.local.yaml"
echo " check the source folder against the dev page's <script src> if the project has an unusual layout"
# Things this command does not change
local custom="$root/.ddev/nginx_full/nginx-site.conf"
if [ -f "$custom" ] && ! grep -q 'ddev-generated' "$custom" && ! grep -q '/mnt/ddev_config/nginx/\*.conf' "$custom"; then
echo " ! $custom is customised and does not include /mnt/ddev_config/nginx/*.conf; add that include inside the server block"
fi
local docroot
docroot=$(grep -E '^docroot:' "$root/.ddev/config.yaml" 2>/dev/null | head -n1 | sed -E 's/^docroot:[[:space:]]*//; s/["'"'"']//g')
for f in $src; do
if [ -n "$docroot" ] && [ -e "$root/$docroot/$f" ]; then
echo " ! /$f/ also exists in the docroot ($docroot/$f); the proxy would send those URLs to Vite instead. Check that no real page or file lives there"
fi
done
if ! grep -q 'VITE_SAME_ORIGIN' "$cfg"; then
echo " ! ${cfg#$root/} needs the same-origin switch (tracked file, default behaviour unchanged):"
echo " const sameOrigin = process.env.VITE_SAME_ORIGIN === \"true\";"
echo " server: { hmr: sameOrigin ? { path: \"__vite_hmr\" } : undefined, origin: sameOrigin ? undefined : \"<existing origin>\" }"
fi
if [ -n "$craft_dir" ]; then
local pub
pub=$(grep -E '^VITE_DEV_SERVER_PUBLIC=' "$craft_dir/.env" 2>/dev/null | tail -n1 | cut -d= -f2- | tr -d "\"'")
[ "$pub" = "/" ] || echo " ! ${craft_dir#$root/}/.env needs VITE_DEV_SERVER_PUBLIC=\"/\" (now: ${pub:-unset}); keep VITE_DEV_SERVER_INTERNAL"
fi
local where="the project root"; [ "$pkg_dir" = "." ] || where="$pkg_dir"
echo " then: ddev restart, start Vite from $where, ddev lan on"
}
# Craft: checks that every site's base URL follows the request host. Reports only; .env is yours to edit.
init_craft() {
local dir="$1" env_file="$1/.env" entry name value found=0 todo=0
local project
project=$(basename "${DDEV_APPROOT:-$PWD}")
if [ ! -f "$env_file" ]; then
echo "No .env in $dir; nothing to check" >&2
exit 1
fi
local entries
entries=$(grep -h -E '^[[:space:]]*baseUrl:' "$dir"/config/project/sites/*.yaml 2>/dev/null \
| sed -E "s/^[[:space:]]*baseUrl:[[:space:]]*//; s/[\"']//g" | sort -u)
if [ -z "$entries" ]; then
echo "No site base URLs found in $dir/config/project/sites/*.yaml" >&2
exit 1
fi
echo "Craft project ($dir/.env). Site base URLs:"
while IFS= read -r entry; do
found=$((found + 1))
case "$entry" in
\$*)
name=${entry#\$}
value=$(grep -E "^${name}=" "$env_file" | tail -n1 | cut -d= -f2- | sed -E "s/^[\"']//; s/[\"']\$//")
;;
@web*)
echo " ok baseUrl $entry (set in the project config)"
continue
;;
*)
echo " ! baseUrl \"$entry\" is written into the project config (a tracked file), not an env variable."
echo " Change it to an env variable first, e.g. baseUrl: \$SITE_URL"
todo=$((todo + 1))
continue
;;
esac
if [ -z "$value" ]; then
echo " ! $name is empty or missing; that site will 404. Set it, e.g. $name=\"@web\" (or \"@web/en\")"
todo=$((todo + 1))
elif [[ "$value" == @web* ]]; then
echo " ok $name=$value"
elif [[ "$value" =~ ^https?://[^/]+(/.*)?$ ]]; then
echo " ! $name=$value"
echo " -> $name=\"@web${BASH_REMATCH[1]%/}\""
todo=$((todo + 1))
else
echo " ? $name=$value (not recognised; check by hand)"
todo=$((todo + 1))
fi
done <<< "$entries"
# Other absolute local URLs in .env (may be intentional)
local others
others=$(grep -E '^[A-Za-z0-9_]+=.*[.]ddev[.]site' "$env_file" | cut -d= -f1 | sort -u \
| grep -v -x -F "$(printf '%s\n' "$entries" | sed -E 's/^\$//')" | tr '\n' ' ')
if [ -n "$others" ]; then
echo "Other values with a ddev.site URL (fine if they are not shown in the page): $others"
fi
if [ "$todo" -eq 0 ]; then
echo "All $found site base URLs follow the request host."
else
echo "$todo of $found need a change. Back up .env first. Then: ddev restart, ddev lan on"
fi
}
# Writes or checks the local-only setup a project needs for LAN sharing (Bedrock, Craft, Vite).
init() {
local root="${DDEV_APPROOT:-$PWD}" craft
if [ -f "$root/config/application.php" ] && grep -q 'roots/wp-config' "$root/composer.json" 2>/dev/null; then
init_bedrock "$root"
init_vite "$root" ""
return
fi
craft=$(find "$root" -maxdepth 2 -name craft -type f -not -path '*/vendor/*' -not -path '*/node_modules/*' 2>/dev/null | head -n1)
if [ -n "$craft" ]; then
init_craft "$(dirname "$craft")"
init_vite "$root" "$(dirname "$craft")"
return
fi
echo "Not a Bedrock or Craft project; nothing to do" >&2
exit 1
}
# Path the site starts at: nothing for Bedrock; for Craft, the path of the primary site's base URL (e.g. /en)
start_path() {
local root="${DDEV_APPROOT:-$PWD}" craft dir file entry value
[ -f "$root/config/application.php" ] && return
craft=$(find "$root" -maxdepth 2 -name craft -type f -not -path '*/vendor/*' -not -path '*/node_modules/*' 2>/dev/null | head -n1)
[ -n "$craft" ] || return
dir=$(dirname "$craft")
file=$(grep -l -E '^[[:space:]]*primary:[[:space:]]*true' "$dir"/config/project/sites/*.yaml 2>/dev/null | head -n1)
[ -n "$file" ] || return
entry=$(grep -E '^[[:space:]]*baseUrl:' "$file" | head -n1 | sed -E "s/^[[:space:]]*baseUrl:[[:space:]]*//; s/[\"']//g")
case "$entry" in
\$*) value=$(grep -E "^${entry#\$}=" "$dir/.env" 2>/dev/null | tail -n1 | cut -d= -f2- | sed -E "s/^[\"']//; s/[\"']\$//") ;;
*) value=$entry ;;
esac
value=${value#@web}
value=$(printf '%s' "$value" | sed -E 's#^https?://[^/]+##; s#/$##')
printf '%s' "$value"
}
status() {
local enabled ip target current
enabled=$(ps "(Get-NetFirewallRule -DisplayName '$RULE' -ErrorAction SilentlyContinue).Enabled")
ip=$(ps "(Get-NetIPConfiguration | Where-Object { \$_.IPv4DefaultGateway -and \$_.NetAdapter.Status -eq 'Up' } | Select-Object -First 1).IPv4Address.IPAddress")
case "$enabled" in
True)
local url="http://${ip:-<PC-IP>}:$PORT$(start_path)"
echo "LAN access is ON: $url"
target=$(forward_port)
current=$(web_port)
if [ -z "$target" ]; then
echo "Warning: no port forward for $PORT (run the one-time machine setup first)" >&2
elif [ -n "$current" ] && [ "$target" != "$current" ]; then
echo "Warning: the forward points at port $target, but this project is on $current. Run: ddev lan on" >&2
fi
if [ "$1" = "qr" ] && [ -n "$ip" ] && command -v qrencode >/dev/null; then
qrencode -t ANSIUTF8 -m 2 "$url"
fi
;;
False) echo "LAN access is OFF" ;;
*) echo "Firewall rule \"$RULE\" not found" >&2; exit 1 ;;
esac
}
case "${1:-status}" in
on)
port=$(web_port)
[ -n "$port" ] || { echo "Run this from a running DDEV project (ddev start first)" >&2; exit 1; }
[ "$(ps_admin "netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=$PORT; netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=$PORT connectaddress=127.0.0.1 connectport=$port; Enable-NetFirewallRule -DisplayName '$RULE'")" = "ok" ] || { echo "Cancelled" >&2; exit 1; }
status qr
;;
off)
[ "$(ps_admin "Disable-NetFirewallRule -DisplayName '$RULE'")" = "ok" ] || { echo "Cancelled" >&2; exit 1; }
status
;;
status)
status
;;
init)
init
;;
*)
echo "Usage: ddev lan [on|off|status|init]" >&2
exit 1
;;
esacPhew, that's it! #
It's plain HTTP, so the camera, the clipboard and service workers will sulk.
One more thing: While it's on, anyone on your network can open the site. So ddev lan off when you're done. To get rid of it all, delete the forward and the firewall rule, and the local files in each project. In an admin PowerShell, that's:
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=8081
Remove-NetFirewallRule -DisplayName "DDEV LAN 8081"