Skip to content

SheikhMahdin/LAN-Remote-Desktop-Controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LAN-Remote-Desktop-Controller

πŸ–₯️ LAN Remote Desktop Controller

Browser-based remote desktop tool for your local network β€” live screen streaming, full mouse & keyboard control, and system power management, protected by password authentication.


✨ Features

Feature Details
πŸ” Password Login Secure session-based authentication
πŸ“Ί Live Streaming Up to 60 FPS screen streaming
πŸ–±οΈ Mouse Control Left click, right click, double click
⌨️ Keyboard Input Send text to the remote PC
⚑ Power Controls Sleep, Restart, Shutdown (with confirmation)
🌐 Cross-Device Works from any browser β€” PC, phone, tablet
πŸ” Auto-Start Runs silently on Windows boot

πŸ“ Project Structure

web_control/
β”œβ”€β”€ main.py              # Entry point β€” run this to start
β”œβ”€β”€ server.py            # Flask routes & SocketIO events
β”œβ”€β”€ auth.py              # Login, logout, session management
β”œβ”€β”€ screen.py            # Screen capture & streaming logic
β”œβ”€β”€ control.py           # Mouse & keyboard control
β”œβ”€β”€ system.py            # Shutdown / restart / sleep
β”œβ”€β”€ config.py            # All settings in one place
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ login.html       # Login page
β”‚   └── index.html       # Main control UI
β”œβ”€β”€ static/
β”‚   └── app.js           # Frontend JavaScript
β”œβ”€β”€ requirements.txt     # Python dependencies
└── start_remote.bat     # Windows auto-start script

πŸ“‹ Requirements

  • OS: Windows 10 / 11 (also works on Linux and macOS)
  • Python: 3.10 or higher
  • Network: Both devices must be on the same Wi-Fi

πŸš€ Setup & Installation

Step 1 β€” Install Dependencies

Open Command Prompt and run:

pip install flask flask-socketio pyautogui mss pillow python-socketio werkzeug

Or use the requirements file:

pip install -r requirements.txt

Step 2 β€” Change the Default Password

Open config.py and update the credentials:

USERNAME = "admin"           # Change this
PASSWORD_HASH = generate_password_hash("admin123")  # Change this

To generate a secure password hash, run this in Python:

from werkzeug.security import generate_password_hash
print(generate_password_hash("your_new_password"))

Then paste the output as the value of PASSWORD_HASH.

Also update the secret key:

SECRET_KEY = 'a1b2c3d4e5f6-change-this-to-any-long-random-string'

Step 3 β€” Run the Server

cd D:\codeing\web_control
python main.py

The terminal will show:

  Local:    http://localhost:5000
  Network:  http://192.168.0.117:5000

Open the Network URL on any device connected to the same Wi-Fi.


πŸ” Auto-Start on Windows Boot

To make the server start automatically and silently every time Windows starts:

Step 1 β€” Edit start_remote.bat

Make sure these paths match your system:

@echo off
cd /d "D:\codeing\web_control"
start "" "C:\Users\YourUsername\AppData\Local\Programs\Python\Python310\pythonw.exe" "D:\codeing\web_control\main.py"
exit

pythonw.exe runs the server silently in the background β€” no terminal window.

Step 2 β€” Open the Startup Folder

Press Win + R, type the following, and press Enter:

shell:startup

Step 3 β€” Place the .bat File

Copy start_remote.bat into the Startup folder. Done β€” the server will now start automatically on every boot.


🌐 Accessing the Controller

Device URL
Same PC http://localhost:5000
Phone / Tablet / Other PC http://<PC-LOCAL-IP>:5000

To find your PC's local IP, open Command Prompt and type ipconfig. Look for IPv4 Address under your active network adapter.


πŸ” Logging In

When you open the URL on any device, you'll see the login page. Enter your username and password. After a successful login, you'll be taken to the control panel.

All login attempts (successful and failed) are printed in the server terminal.


πŸ–±οΈ How to Use

Action How
Left Click Single click on the screen canvas
Right Click Right-click on the screen canvas
Double Click Double-click on the screen canvas
Type Text Enter text in the input box β†’ click Send Text or press Enter
Start Streaming Click Start Streaming to begin live view
Stop Streaming Click Stop Streaming to pause
Screenshot Click Single Screenshot for a one-time capture
Sleep System Controls β†’ πŸ’€ Sleep (confirmation required)
Restart System Controls β†’ πŸ”„ Restart (confirmation required)
Shutdown System Controls β†’ ⚑ Shutdown (confirmation required)
Logout Click the Logout button in the top-right corner

βš™οΈ Configuration Reference

All settings are in config.py:

Setting Default Description
PORT 5000 Server port
SECRET_KEY (change this) Flask session encryption key
USERNAME admin Login username
PASSWORD_HASH admin123 hashed Login password
FPS 60 Streaming frame rate
CAPTURE_WIDTH 1280 Stream resolution width
CAPTURE_HEIGHT 720 Stream resolution height
JPEG_QUALITY 60 Image compression (1–95)
DEBUG False Flask debug mode

πŸ›‘ Stopping the Server

If running in terminal: Press Ctrl + C

If running silently via .bat (auto-start):

  1. Press Ctrl + Shift + Esc to open Task Manager
  2. Find pythonw.exe under Background Processes
  3. Right-click β†’ End Task

πŸ”§ Troubleshooting

Showing "Disconnected" on mobile?

  • Make sure both devices are on the same Wi-Fi network
  • Verify manage_session=False is set in server.py
  • Verify withCredentials: true is set in static/app.js
  • Try opening the URL in a different browser

TemplateNotFound: login.html error?

  • Make sure login.html and index.html are inside a templates/ folder
  • Make sure app.js is inside a static/ folder

Screen not capturing?

  • Run the server as Administrator on Windows
  • Make sure mss and pillow are installed

Low FPS?

  • Lower CAPTURE_WIDTH and CAPTURE_HEIGHT in config.py
  • Lower JPEG_QUALITY for faster encoding

⚠️ Security Warning

  • This tool gives full control of your PC to anyone who accesses it
  • Always change the default username and password before use
  • Only use on trusted private networks β€” never expose port 5000 to the internet
  • Power actions (Restart/Shutdown) require confirmation but execute quickly β€” use with care
  • All login attempts and system actions are logged in the server terminal

πŸ“œ License

This project is open source and free to use for personal and educational purposes.

About

πŸ–₯️ Browser-based LAN remote desktop β€” live screen streaming, mouse & keyboard control, and system power management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors