Skip to content

About

Python-based remote desktop app with secure video streaming and control, featuring a simple GUI for both client and server.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

34 Commits

Folders and files

Repository files navigation

alt-text

AnyDeskApp

A simple Python-based remote desktop application inspired by AnyDesk. This project allows you to remotely view and control another machine's desktop over a secure WebSocket connection, using OpenCV for video streaming and pyautogui for remote control.

Features

  • Remote desktop video streaming (JPEG over WebSocket)
  • Mouse and keyboard control of the remote machine
  • Simple Tkinter-based launcher GUI for both client and server roles
  • Encrypted communication using self-signed SSL certificates

Prerequisites

  • Python 3.7+
  • pip
  • OpenSSL (for generating self-signed certificates)

Installation

  1. Clone the repository:

    git clone https://github.com/DivSlayer/AnyDeskApp.git
    cd AnyDeskApp
  2. Install dependencies:

    py -m venv venv
    #windows
    cd venv/scripts && activate && cd ../..
    #ubuntu
    cd venv/bin && source activate && cd ../..
    pip install -r requirements.txt
  3. Generate SSL certificates: The server requires cert.pem and key.pem in the project directory. You can generate them using either OpenSSL or mkcert:

    Option 1: OpenSSL

    openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365

    Follow the prompts to fill in certificate details.

    Option 2: mkcert mkcert is a simple tool for making locally-trusted development certificates. It is easier and avoids browser warnings for local development.

    1. Install mkcert (see mkcert installation instructions)
    2. Run the following commands in your project directory:
      mkcert -install
      mkcert -key-file key.pem -cert-file cert.pem 127.0.0.1 ::1 localhost
      • This will generate cert.pem and key.pem valid for localhost and 127.0.0.1.
      • If you want to use a different IP (e.g., your LAN IP), add it to the command:
        mkcert -key-file key.pem -cert-file cert.pem 127.0.0.1 ::1 localhost <your-ip>
      • You can check your local IP in the GUI or with ipconfig/ifconfig.

Usage

1. Launch the GUI

Run the launcher:

python gui.py

2. Start as Server (Remote Machine)

  • Select "Be Remote Machine" in the GUI.
  • Optionally override the detected local IP and set the port (default: 8765).
  • Click "Start Server". The server will start in the background.

3. Start as Client (Viewer)

  • Select "Connect to Remote" in the GUI.
  • Enter the server's IP and port.
  • Click "Connect". A new window will open showing the remote desktop. Mouse and keyboard events will be sent to the remote machine.

4. Exiting

  • To disconnect, close the viewer window or use the GUI's disconnect option.
  • To stop the server, close the terminal or kill the process.

File Overview

  • gui.py — Tkinter-based launcher for both client and server roles
  • viewer.py — Client: connects to remote server, displays video, sends control events
  • remote_machine.py — Server: streams desktop, receives and executes control events
  • requirements.txt — Python dependencies

Notes

  • Security: This is a demo project. For real-world use, improve authentication and certificate handling.
  • Platform: Tested on Windows. Some features (e.g., pyautogui, mss) may require additional setup on other OSes.
  • Firewall: Ensure the chosen port is open on both client and server machines.

Troubleshooting

  • If you see SSL errors, ensure cert.pem and key.pem are present and valid.
  • If the video window does not appear, check that the server is running and reachable.
  • For issues with mouse/keyboard control, ensure the remote machine allows control and that pyautogui is installed.

License

See LICENSE.

About

Python-based remote desktop app with secure video streaming and control, featuring a simple GUI for both client and server.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages