A React Native mobile app paired with a Python WebSocket server that lets you control your Windows laptop remotely from your phone — over your local Wi-Fi network.
- 🔌 WebSocket-based real-time communication between phone and PC
- ⚡ Instant commands — shutdown, restart, sleep, volume & brightness control
- 🖥️ Run any shell command on your laptop from the app
- 🔒 Security layer — blocks dangerous commands (format, rm -rf, registry edits, etc.)
- ⏱️ Command timeout — auto-kills commands that take too long
- 💓 Ping/heartbeat — check server uptime from the app
- 📱 Built with React Native 0.84 + TypeScript
┌─────────────────────┐ WebSocket (ws://) ┌────────────────────────┐
│ 📱 Mobile App │ ──────────────────────────► │ 💻 Python Server │
│ (React Native) │ ◄────────────────────────── │ (server.py) │
│ Android / iOS │ JSON responses │ Port 8765 │
└─────────────────────┘ └────────────────────────┘
- Python 3.10+
websocketslibrary
pip install websocketsOptional: Install nircmd for volume & brightness control commands on Windows.
- Node.js >= 22.11.0
- React Native environment set up → React Native Environment Setup
- Android Studio (for Android) or Xcode (for iOS/macOS only)
python server.pyYou'll see output like:
============================================
Laptop Control System — Server v2
============================================
[12:00:00] [*] Starting server…
[12:00:00] [*] Mobile app IP : 192.168.1.100
[12:00:00] [*] Listening on : ws://192.168.1.100:8765
Note down the IP address — you'll need it in the app.
Start the Metro bundler:
npm startThen in a separate terminal, run on your device:
# Android
npm run android
# iOS (macOS only)
npm run iosEnter the WebSocket URL in the app:
ws://YOUR_LAPTOP_IP:8765
Make sure your phone and laptop are on the same Wi-Fi network.
| Command | Action |
|---|---|
shutdown |
Shutdown the laptop in 5s |
restart |
Restart the laptop in 5s |
sleep |
Put the laptop to sleep |
vol_up |
Increase system volume |
vol_down |
Decrease system volume |
bright_up |
Increase screen brightness |
bright_down |
Decrease screen brightness |
ping |
Check server connection/uptime |
You can send any Windows shell command directly through the app (e.g., notepad, ipconfig, tasklist).
The following commands are blocked and will return an error:
format,del /s /f,rd /s,rmdir /srm -rf,rm -fr,mkfs,dd if=- Fork bombs (
:(){:|:&};:) shutdown /f(forced shutdown)- Registry edits (
reg delete,bcdedit) cipher /w,sfc /scannow /offbootdir
Commands also have a 10-second timeout to prevent hanging.
LaptopControlSystem/
├── server.py # Python WebSocket server (run on laptop)
├── App.tsx # Main React Native app screen
├── index.js # Entry point
├── android/ # Android native project
├── ios/ # iOS native project
├── package.json # Node.js dependencies
└── tsconfig.json # TypeScript config
| Layer | Technology |
|---|---|
| Mobile App | React Native 0.84, TypeScript |
| Server | Python 3, asyncio, websockets |
| Communication | WebSocket (JSON messages) |
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.