A Python remote desktop application built from scratch using socket programming. Streams a host machine's screen to a remote client in real time and supports remote mouse & keyboard control — replicating the core functionality of tools like AnyDesk and TeamViewer.
- 📡 Real-time screen capture & transmission over TCP sockets
- 🏗️ Clean client-server architecture
- ⚡ Low-latency frame streaming using Python sockets
| Layer | Technology |
|---|---|
| Language | Python 3.x |
| Networking | TCP Socket Programming |
| Screen Capture | Pillow (PIL) / PyAutoGUI |
| Remote Control | PyAutoGUI |
| Data Transfer | socket + pickle / struct |
┌──────────────────────┐ TCP ┌──────────────────────┐
│ HOST (server.py) │ ──────────────────────────► │ CLIENT (client.py) │
│ │ Compressed screen frames │ │
│ Captures screen │ ◄────────────────────────── │ Displays stream │
│ Executes commands │ Mouse & keyboard events │ Sends input events │
└──────────────────────┘ └──────────────────────┘
- Python 3.8+
- Both machines on the same network (or use port forwarding for remote)
# Clone the repo
git clone https://github.com/senseihx4/anydesk-clone.git
cd anydesk-clone
# Install dependencies
pip install pillow pyautogui opencv-python numpyStep 1 — Start the server on the host machine (the one being controlled):
python server.pyNote the IP address shown in the terminal.
Step 2 — Start the client on the remote machine:
python client.py
# Enter the host IP when promptedanydesk-clone/
├── server.py # Host side — captures screen, receives input events
├── client.py # Client side — displays stream, sends mouse/KB events
├── utils.py # Shared helpers (compression, encoding)
└── requirements.txt
- SSL/TLS encrypted connection
- Session password protection
- File transfer between machines
- GUI for connection setup (Tkinter)
- FPS counter & quality selector
- Cross-platform packaging (.exe / .app)
- How TCP sockets work for real-time data streaming
- Screen capture and frame compression techniques
- Serializing and deserializing data with
pickleandstruct - Building a client-server system from scratch without any networking libraries