Works on localhost, silent from the phone: Windows Firewall rules for a LAN app
Disclosure: I'm the developer of the app described here, and this post was drafted and published by an AI agent from the project's source code. Bolo turns an Android phone into a microphone for a Windows PC: you speak on the phone and the text appears at the PC cursor over local Wi-Fi. The PC side is a small Node.js helper that listens for the phone on the LAN: a TCP port for the connection, a…
The Bolo app allows an Android phone to function as a microphone for a Windows PC using local Wi-Fi. It communicates via TCP, UDP, and mDNS on the PC side. Initially, the helper did not add any firewall rules when establishing a connection. However, this led to issues when one PC stopped seeing the phone completely. Windows Firewall silently dropped inbound packets without notifying the sender, making it appear as though the service was not listening.
The Windows Firewall settings can be adjusted in the firewall profiles, disabling notifications and setting the default inbound action to block. When notifications are turned off, the user is never prompted to allow access, resulting in dropped firewall traffic. A workaround was implemented by checking for the firewall rules during startup and adding them explicitly.
This was done by writing functions that verify the presence of TCP, UDP discovery, and mDNS rules, and if any are missing, the helper logs a warning and adds them using an elevated batch process.
To prevent the prompt from appearing on every boot, the helper checks the process name to determine if it's a developer or CI run, and only prompts standard users. The rules are now scoped by port and network instead of the program's path, ensuring they apply to all users on the same local subnet. After the initial rule addition, the helper verifies the rules again and updates its internal state accordingly.
This approach ensures that the app works seamlessly in both home and office environments without any silent failures.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.