-
-
Notifications
You must be signed in to change notification settings - Fork 1
Connect FMMatchLens over LAN with Caddy
FMMatchLens can be accessed from another device on the same local network by using Caddy as a lightweight reverse proxy and static file server.
With this setup, Caddy will:
- Serve the built FMMatchLens Dashboard
- Forward
/api/*requests to the FMMatchLens backend - Forward WebSocket connections
- Expose the Dashboard and backend through a single LAN address
Another device on the LAN
│
│ http://192.168.x.x:16727
▼
Caddy
│
├── / → Dashboard files
│
├── /api/* → 127.0.0.1:16726
│
└── /ws* → 127.0.0.1:16726
│
▼
FMMatchLens Backend
The FMMatchLens backend itself can continue listening only on:
127.0.0.1:16726
Caddy acts as the LAN-facing entry point.
Download Caddy from the official website:
https://caddyserver.com/download
Place caddy.exe in a directory together with the Dashboard build.
For example:
FMMatchLens-LAN/
├── caddy.exe
├── Caddyfile
└── dist/
├── index.html
├── assets/
└── ...
The dist directory should contain the production build of the FMMatchLens Dashboard.
Create a file named:
Caddyfile
with the following configuration:
http://:16727 {
root * ./dist
handle /api/* {
reverse_proxy 127.0.0.1:16726
}
handle /ws* {
reverse_proxy 127.0.0.1:16726
}
handle {
try_files {path} /index.html
file_server
}
}root * ./dist
Serves the FMMatchLens Dashboard from the local dist directory.
handle /api/*
Forwards all API requests to the FMMatchLens backend:
http://192.168.x.x:16727/api/...
becomes:
http://127.0.0.1:16726/api/...
handle /ws*
Forwards WebSocket connections to the FMMatchLens backend.
Caddy supports WebSocket proxying automatically, so no additional WebSocket configuration is required.
try_files {path} /index.html
Provides SPA fallback for the Dashboard.
This allows routes such as:
/match
/analysis
/settings
to work correctly when opened or refreshed directly.
Start Football Manager and make sure the FMMatchLens plugin is running.
You can verify the backend locally by opening:
http://127.0.0.1:16726/api/match/status
If the backend is working, it should return the current FMMatchLens status.
Open PowerShell in the directory containing caddy.exe and Caddyfile.
Run:
.\caddy.exe validate --config .\CaddyfileIf the configuration is valid, Caddy should report that the configuration is valid.
Run:
.\caddy.exe run --config .\CaddyfileCaddy will now listen on:
http://0.0.0.0:16727
You can test it locally:
http://127.0.0.1:16727
The FMMatchLens Dashboard should load.
You can also test the proxied API:
http://127.0.0.1:16727/api/match/status
On Windows, run:
ipconfigFind the IPv4 address of the network adapter currently connected to your LAN.
For example:
IPv4 Address . . . . . . . . . . : 192.168.1.100
Your FMMatchLens Dashboard will then be available at:
http://192.168.1.100:16727
Open this address on another computer, tablet, or phone connected to the same network.
If the Dashboard works on the host computer but cannot be accessed from another device, Windows Firewall is likely blocking incoming connections.
Open PowerShell as Administrator and run:
New-NetFirewallRule `
-DisplayName "FMMatchLens Caddy LAN" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 16727 `
-Action Allow `
-Profile PrivateThis allows TCP port 16727 on Private networks.
For additional security, you can restrict access to your local subnet.
For example:
New-NetFirewallRule `
-DisplayName "FMMatchLens Caddy LAN" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 16727 `
-RemoteAddress 192.168.1.0/24 `
-Action Allow `
-Profile PrivateAdjust the subnet according to your local network.
For example:
Dashboard
http://192.168.1.100:16727
Check:
- Both devices are connected to the same local network
- The host PC is using a Private network profile
- TCP port
16727is allowed through Windows Firewall - Caddy is still running
- You are using the correct LAN IP address
You can verify that Caddy is listening with:
netstat -ano | findstr :16727You should see a listening entry for port 16727.
First check the FMMatchLens backend directly:
http://127.0.0.1:16726/api/match/status
Then check the same endpoint through Caddy:
http://127.0.0.1:16727/api/match/status
If the first works but the second does not, check the Caddy console output.
This may indicate a WebSocket connection problem.
Check the browser Developer Tools:
Network → WS
The WebSocket URL should use the Caddy address, for example:
ws://192.168.1.100:16727/ws
rather than connecting directly to:
ws://127.0.0.1:16726
from the remote device.
Make sure the Caddyfile contains:
try_files {path} /index.htmlThis is required for client-side routing used by the Dashboard.
This setup is intended for use on a trusted local network.
The FMMatchLens backend remains bound to:
127.0.0.1:16726
and is not exposed directly to the network.
Only Caddy exposes port:
16727
For this reason, it is recommended to:
- Use this only on trusted Private networks
- Restrict the Windows Firewall rule to Private networks
- Avoid forwarding port
16727on your router - Do not expose this configuration directly to the public Internet
Host PC:
LAN IP: 192.168.1.100
FMMatchLens Backend: 127.0.0.1:16726
Caddy: 0.0.0.0:16727
Open on another device:
http://192.168.1.100:16727
The same address provides the Dashboard, API, and WebSocket connection through Caddy.