A powerful, lightweight Python tool to send and receive messages across your Local Area Network (LAN). It supports direct messaging via TCP and network-wide broadcasting via UDP, with instant desktop notifications.
Follow these steps to get the msg command working on your machine.
Clone this repository or download the source code to your machine:
git clone https://github.com/ragibalasad/lan-shout.git
cd lan-shoutTo use the tool by simply typing msg from any terminal directory, you need to install it using pip.
Option A: Standard Installation (Best for users)
pip install .Option B: Editable Installation (Best for developers) Changes you make to the code will take effect immediately.
pip install -e .Note: Depending on your system, you might need to use
pip3or ensure your Python scripts folder is in your system's PATH.
The tool operates in two modes: Listening (to receive) and Sending (to talk).
Run this command to start the background server. It will listen for both direct and broadcast messages.
msg --listen- You can also use the short version:
msg -l - It will display your Local IP Address. Share this with others so they can message you directly.
- Keep this terminal window open.
To send a private message to a specific device on your network:
msg <ip-address> <your message>Example:
msg 192.168.1.15 "Hey, are we still meeting at 5?"To send a message to every single device on the LAN that is running the listener:
msg <your message>(If the first word isn't a valid IP address, the tool automatically switches to broadcast mode.)
Example:
msg "Pizza is here in the breakroom!"Note: You will also receive a notification for your own broadcast messages.
For the tool to work across different machines:
- Same Network: Both devices must be connected to the same Wi-Fi or local network.
- Firewall: Your OS firewall must allow incoming connections on Port 9999 (TCP and UDP).
- On Linux (ufw):
sudo ufw allow 9999 - On Windows: Add an inbound rule for Port 9999 in Windows Defender Firewall.
- On Linux (ufw):
- Python 3.x
plyer(automatically installed viapip install .)