Skip to content

Remote Desktop Application for operating a pc remotely. Leverages Multithreaded Socket Programming and Java Native Access.

Notifications You must be signed in to change notification settings

Aaditatgithub/Remote-Desktop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Remote Desktop

Introduction

The "Remote Desktop" project allows users to remotely control another computer. It consists of two main components: a Client and a Server. The Client application allows the user to specify the server's IP address and connect to it, while the Server is responsible for managing connections and sharing the screen, cursor, and keyboard events.

The client app is built with Java Swing for the graphical user interface, while the server app handles the backend tasks of capturing the screen, processing input events, and sending the data over the network.

This project is perfect for applications like remote support, screen sharing, or remote administration.

Architecture

Remote-Desktop-Architecture

The architecture consists of two major components:

1. Client

  • Purpose: The client application connects to the server, sends user input (mouse and keyboard events), and displays the server's screen.
  • Main Features:
    • Control Panel: Allows users to input the server IP address and connect.
    • Network Communication: Connects to the server via TCP sockets for real-time communication.
    • Screen Display: Displays the server's screen (video stream) using a custom ScreenPanel.
    • Mouse and Keyboard Input: Captures user input (mouse movements, clicks, and keyboard presses) and sends it to the server.

Flow:

  • The user enters the server IP in the control panel.
  • The client connects to the server and starts receiving the screen data.
  • The user can interact with the remote machine using mouse and keyboard inputs.

2. Server

  • Purpose: The server handles connections from multiple clients, captures the screen, and transmits the screen data over the network.
  • Main Features:
    • Screen Capture: Captures the desktop screen and encodes it for transmission.
    • Mouse and Keyboard Event Handling: Listens for mouse and keyboard input events from clients and processes them on the remote machine.
    • Compression and Streaming: Compresses the captured screen to reduce latency and sends it to the client.

Flow:

  • The server listens for incoming client connections.
  • Once connected, it starts sending the screen data and handling input events from the client.

Communication

  • The client and server communicate over TCP sockets:
    • The screen data is transmitted as compressed image frames.
    • Mouse movements and clicks, as well as keyboard inputs, are sent from the client to the server for execution.

Screenshots

RemoteDesktopWorking

Setting Up the Project

Follow these steps to set up and run the project locally.

Prerequisites

  • Java Development Kit (JDK) 8 or above
  • Maven (optional, if you wish to build with Maven)
  • IDE such as IntelliJ IDEA or Eclipse

1. Clone the Repository

git clone https://github.com/yourusername/remote-desktop.git
cd remote-desktop

2. Build the Project

If you are using Maven, run the following command:

mvn clean install

Alternatively, you can build the project manually by compiling the Java files.

3. Run the Server

  1. Navigate to the server folder.
  2. Compile and run the server:
javac Server.java
java Server

The server will start and begin listening for client connections.

4. Run the Client

  1. Navigate to the client folder.
  2. Compile and run the client:
javac NetworkScreenClient.java
java NetworkScreenClient
  1. In the client window, input the server's IP address (e.g., localhost or the server's actual IP address).
  2. Click Connect to establish the connection. The client should begin displaying the server's screen.

5. Interaction

Once the connection is established:

  • The client will display the server's screen.
  • You can control the remote system by moving the mouse and typing on the keyboard.
  • The server will receive the mouse and keyboard events and respond accordingly.

File Structure

/remote-desktop
│
├── client/
│   ├── NetworkScreenClient.java      # Client app that connects to the server and displays the screen.
│   └── ScreenPanel.java              # Panel for displaying the remote screen and capturing input events.
│
└── server/
    ├── JNAScreenshot.java            # Captures the screen and sends image data to clients.
    └── NetworkScreenServer.java      # Handles keyboard and mouse input from clients.

What's happening here?

Planning to optimize it via Executors Service and Compression mechanisms for low latency.

About

Remote Desktop Application for operating a pc remotely. Leverages Multithreaded Socket Programming and Java Native Access.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published