CFE Chat 🚀
A fully decentralized, serverless peer-to-peer LAN messenger built with Python 3.13 and CustomTkinter.
Zero configuration. Zero servers. Wire-to-wire encryption. Automatic peer discovery over UDP broadcast.
✨ Features
- 🔗 Zero-Config Auto-Discovery — UDP broadcasts find peers automatically
- 💬 Room & Private DMs — Broadcast to everyone or direct message a peer
- 📁 Fast File Sharing — Chunked transfers with progress bars
- 🔐 Optional Encryption — Shared-secret Fernet encryption for messages
- 🎨 Beautiful Dark GUI — CustomTkinter modern interface
- ⚡ Real-Time Status — Online/offline indicators + connection quality (RTT)
- 💾 Persistent History — Automatic chat logging & contact saving
- 🔤 Text Formatting — Bold, italic, custom colors
- 📢 Notifications — Sound alerts + title bar flashing
- 🛠️ No Setup Required — Just install & run
🚀 Quick Start
Install via pip
pip install cfe-chat
Run
cfe-chat
First Time?
- Enter your nickname
- Optionally set an encryption password (or leave blank)
- App auto-discovers peers on your LAN
- Start chatting!
📋 Requirements
- Python 3.13+ (3.8+ compatible with minor tweaks)
- pip package manager
Dependencies (auto-installed)
customtkinter— Modern GUI frameworkcryptography— Optional encryption supportpillow— Image clipboard support (optional)pystray— System tray icon (optional, experimental)
🎮 Usage
Core Actions
| Action | How |
|---|---|
| Send message | Type → Press Enter or click Send |
| Private DM | Click a peer's name in sidebar |
| Format text | Use B / I / Color buttons |
| Send file | Click "Attach File" button |
| View history | Switch chats—history loads automatically |
| Toggle sound | Click 🔔 icon |
| Clear chat | Click "Clear Chat" button |
Keyboard Shortcuts
Enter— Send messageCtrl+V— Paste image from clipboardCtrl+Return— (For future multi-line support)
🏗️ Architecture
Local Network (LAN / Subnet)
│
├─ Computer A (You)
│ └─ CFE Chat (listening on TCP:2222, UDP:2223)
│
├─ Computer B (Peer)
│ └─ CFE Chat (listening on TCP:2222, UDP:2223)
│
└─ Computer C (Peer)
└─ CFE Chat (listening on TCP:2222, UDP:2223)
Auto-discovery via UDP broadcast every 2.5 seconds
Direct P2P messaging over TCP
File transfer with chunked streaming
🔒 Privacy & Security
✅ No cloud. No servers. No tracking.
- All data stays on your computer & LAN
- No internet required
- No analytics or telemetry
- MIT Licensed — fully open source
- Optional encryption available for sensitive chats
⚙️ Configuration
No configuration files needed. Everything is automatic.
Want to customize? Edit cfe_chat_v5.py:
PORT = 2222 # TCP server port
BROADCAST_PORT = 2223 # UDP discovery port
FILE_CHUNK_SIZE = 64 * 1024 # File transfer chunk size
DISCOVERY_INTERVAL = 2.5 # Discovery broadcast interval (seconds)
SOCKET_TIMEOUT = 15 # Connection timeout (seconds)
HISTORY_LIMIT = 500 # Max messages per conversation
📂 Data Storage
All data stored locally in ./chat_data/:
chat_data/
├── log.txt # Chat history log
├── history.json # Message history (500 per conversation)
├── contacts.json # Saved contacts + last seen
├── error.log # Error diagnostics
└── received_files/ # Downloaded files
Cross-platform paths are auto-detected (Windows/macOS/Linux).
⚠️ Known Limitations
System Tray (Experimental)
- May not start reliably on all systems
- Workaround: Run without tray or restart application
Clipboard Image Paste (Experimental)
- Windows: ✅ Works
- Linux: ⚠️ May need
xcliporxsel:apt install xclip xsel - macOS: ⚠️ Requires permission grant
- Workaround: Use "Attach File" button instead
Network Scope
- LAN-only (same subnet)
- Behind strict firewalls may need port forwarding
- VPN/mesh networks supported
🔧 Troubleshooting
Peers not showing up?
# Check if ports are open (macOS/Linux)
sudo lsof -i :2222
sudo lsof -i :2223
# Windows
netstat -ano | findstr :2222
Restart the app if discovery fails.
Can't send messages?
- Check peer is online (green dot)
- Firewall: Allow TCP 2222 & UDP 2223
- If encryption on/off mismatch: restart app
File transfer fails?
- Check disk space
- Files > 2 GB not supported
- Retry the transfer
App crashes?
- Check Python version:
python --version(need 3.8+) - Check logs:
cat chat_data/error.log - Reinstall:
pip install --upgrade cfe-chat
📦 What Gets Installed?
When you pip install cfe-chat:
/usr/local/bin/cfe-chat # Executable script
/site-packages/cfe_chat/ # Package directory
├── __main__.py # Entry point
├── cfe_chat_v5.py # Main application
└── requirements.txt # Dependencies
Run from anywhere: cfe-chat
🚀 Development
Clone & Run Locally
git clone https://github.com/timmoa-cfe/CFE-Chat.git
cd CFE-Chat
pip install -r requirements.txt
python cfe_chat_v5/cfe_chat_v5.py
Building Package for PyPI
pip install build twine
python -m build
twine upload dist/*
📊 Performance
| Metric | Value |
|---|---|
| Max concurrent peers | 16+ |
| Message latency | <50 ms |
| File transfer speed | ~50 Mbps (LAN-limited) |
| Memory footprint | 60–120 MB |
| CPU (idle) | <5% |
🛣️ Roadmap
- PyPI package publishing (v5.0)
- IPv6 support
- Message search & filtering
- Better tray integration
- Cross-platform installers (exe, DMG, AppImage)
- Voice/video calls (v6.0+)
- Message reactions & emoji
- Web interface (optional)
📞 Support
- Telegram: t.me/CFE_Chat
- GitHub Issues: Report bugs
- Documentation: See RELEASE_v5.0.md
📄 License
MIT License © 2026 timmoa-cfe
Permission to use, modify, and distribute freely. See LICENSE for details.
Made with ❤️ for LAN communities.
CFE Chat — Zero config. Pure P2P. All local.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cfe_chat-5.0.0.tar.gz.
File metadata
- Download URL: cfe_chat-5.0.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b06574b4b3f0f86a04a5fc7b08e9f7b907eaec8c5ba29cb256411c362ba7171f
|
|
| MD5 |
c6355dbda025e86bae720820bb4d3cc4
|
|
| BLAKE2b-256 |
046c32537813823e707d69e901c560af6c94004fe40c5f3253398edc5afdaf9b
|
File details
Details for the file cfe_chat-5.0.0-py3-none-any.whl.
File metadata
- Download URL: cfe_chat-5.0.0-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1b887851e89afde584d11725a55afa4a272e571e1e1db932d2cebf428f7c713
|
|
| MD5 |
748e80911936f139370d8bcd7b558850
|
|
| BLAKE2b-256 |
c97e2dd6e595e5d9f15af70e53282aa7414937fd791abf09696d6fc3d52467a2
|