Simple Remote Desktop

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Etayson
Enthusiast
Enthusiast
Posts: 110
Joined: Sun Jun 05, 2016 5:01 pm

Simple Remote Desktop

Post by Etayson »

Simple remote access.(PB 5.31) Windows only.
https://github.com/Etayson/Simple-Remote-Desktop

The program allows you to connect to a remote PC via a proxy server.
The system consists of a client application and a proxy server, through which the connection occurs. If the remote PC is in the same network as you, then the server can be launched on any PC.
If the remote PC is outside the network, then the server must be launched on a PC with an external IP address. The desktop image from the remote PC is encrypted using AEC 256, as are the keystrokes on the keyboard. The copied text is also encrypted.
The program is support transferring files both to and from a remote PC(file transfer does not support encryption). Audio transmission is not supported. Copying an image is also not supported yet.
The launched client application has a unique ID that uniquely corresponds to this PC.
To access a remote PC, you need to know its ID since the common encryption key is calculated based on the ID of the remote and connected PC.
The client ID that initiates the connection can be whitelisted to allow it to connect without permission, otherwise permission will be required to connect. The system is designed so that the traffic between clients is as low as possible. Therefore, it is possible to regulate the quality of the remote desktop stream. By default, the image quality is set to 5, providing a balance between quality and traffic. The value 0 gives a bad image with a lot of artifacts, but with minimal traffic,
while the value 9 gives an ideal image, but with a lot of traffic. The amount of traffic changes depending on how much the desktop on the remote PC changes, if there are no changes, then no traffic is used. Usage:
Run the server application on any pc if they are in the same network, or on a pc with an external ip address.
Run client applications on your PCs, click the server button and set the IP address of the proxy server. Then press the save button.
If you have connected to the server, the text field will show the authorization message and your ID will be shown.
At the bottom of the program, to the left of the connect button, there is a drop-down menu for your white list.
When you first start it, it is empty, so you need to paste the remote client ID here. In fact, the ID looks like a compressed public key.
The remote client ID can be seen in the text field on the remote machine as (Your ID .....) Paste the remote machine's ID into your program in the drop-down list and click the connect button.
Next, on the remote machine, you need to confirm the connection with the accept button or skip it. After successful connection you will see the screen of the remote PC. By clicking the add button you can add PC to the white list on the remote PC and connect without confirmation.
You can also click the add button on your PC to avoid constantly entering the remote client's ID.
Attention! radiobutton allow the remote PC connect to yours PC without permission.
Now you can control the remote PC.
Last edited by Etayson on Thu Jan 23, 2025 12:49 pm, edited 1 time in total.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Simple Remote Desktop

Post by idle »

haven't go time to try it out but I took a quick look through the code.
looks good and should be useful.
benubi
Enthusiast
Enthusiast
Posts: 215
Joined: Tue Mar 29, 2005 4:01 pm

Re: Simple Remote Desktop

Post by benubi »

Cool! It's 100% PureBasic. I'll check it out for sure, test it on Raspberry for example :)
Etayson
Enthusiast
Enthusiast
Posts: 110
Joined: Sun Jun 05, 2016 5:01 pm

Re: Simple Remote Desktop

Post by Etayson »

benubi wrote: Thu Jan 23, 2025 12:01 am Cool! It's 100% PureBasic. I'll check it out for sure, test it on Raspberry for example :)
Unfortunately, the code will not work on Raspberry Pi, only on Windows :oops:. The code uses the Win32 API functions.
benubi
Enthusiast
Enthusiast
Posts: 215
Joined: Tue Mar 29, 2005 4:01 pm

Re: Simple Remote Desktop

Post by benubi »

Ah, don't worry then! Maybe one day you make the big version 2.0 :wink:

For myself I only gathered/adapted Screenshot-procedures for Linux and Windows, also thinking about making something of that sort. But I haven't gone beyond that, no mouse cursor or inputs sent to the "remote desktop", and no "wire-protocol" etc. But I am brewing something in relation to it, a little RPC library that may be the backbone for such an application one day (if need be).
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Simple Remote Desktop

Post by skywalk »

Thanks for the post. I'm also more interested in RPC for RaspberryPI.
@Etayson - Questions?
I notice a lot of embedded ASM. Did you not see similar performance with native calls and compiling with C+optimizer?
Why not the native compression tooling or import external C lib?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Etayson
Enthusiast
Enthusiast
Posts: 110
Joined: Sun Jun 05, 2016 5:01 pm

Re: Simple Remote Desktop

Post by Etayson »

skywalk wrote: Thu Jan 23, 2025 7:00 pm Thanks for the post. I'm also more interested in RPC for RaspberryPI.
@Etayson - Questions?
I notice a lot of embedded ASM. Did you not see similar performance with native calls and compiling with C+optimizer?
Why not the native compression tooling or import external C lib?
To be honest, I've never used C+optimizer. And so embedded ASM is basically a library for Secp256k1 curve.
In the remote access program itself, ASM is almost never encountered.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Simple Remote Desktop

Post by idle »

There's a native modEC curve 25519, could you use that for the pi support?
https://www.purebasic.fr/english/viewtopic.php?t=55892
User avatar
Skipper
User
User
Posts: 40
Joined: Thu Dec 19, 2024 1:26 pm
Location: NW-Europe

Re: Simple Remote Desktop

Post by Skipper »

What is the use case for this? Depending on platform, I use RDP and/or SSH and have some difficulty to understand what this is adding to that?

Cheers
Skipper
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Simple Remote Desktop

Post by Kwai chang caine »

One thousand of thanks for this magical code !!! :shock:
I have been looking for this kind of code for decades, because i not have the level for create it :oops:

A day, the great IDLE create him too, this nice jewel VERA who do the same thing and sharing the EXE 8)
https://www.purebasic.fr/english/viewtopic.php?t=35994

But it's the first time i see a code who do that in PB :shock:
Because there are several years i use VNC or his "brothers" in my job or TEAMVIEWER for my personal use, for help another persons who have a level close to zero in informatic (Yes that exist someone with a level lower that mine :shock: :mrgreen: )
But i find that all this problems of security, change the first VNC versions in real airplane cockpit and again worst for TEAMVIEWER with their accounts :|

So i say to me, have a simple RPC server/client without cryptage, can be usefull in my case, for just do an action during one hour each month or year, with each persons in front of his PC 8)

Thanks again for your precious sharing
I wish you a very very good day, and welcome to our amazing family 8)
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Simple Remote Desktop

Post by Kwai chang caine »

They are several days i try (without real succes i must recognize :oops: ) to understand this splendid code, because like i already say, this subject interest me at the higher point since decades 8)
In fact i'm really surprising, because i always believe that exist a special protocol or WINDOWS function for call and use a RPC, because sending several screenshot by minute in network it's too much slowwer :oops:
But i see nothing about that in this code, apparently Etayson create this function "from scratch" with his personal code, i am even more amazed to see that it is possible. :shock:

More i try this amazing code, and more i'm impressive :shock:
All works with the minimum of Gadgets !!! Remote , transfert file in both directions

In all case....again thanks to Etayson and "hats off" (French expression or admiration "Chapeau bas") for this great present, for finally can see the first code of a PB VNC like, in this forum 8)
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Simple Remote Desktop

Post by Kwai chang caine »

I'm forcing to create a virtual server in my box for the machine who have the server, i don't know if it's normal ? :oops:
ImageThe happiness is a road...
Not a destination
Etayson
Enthusiast
Enthusiast
Posts: 110
Joined: Sun Jun 05, 2016 5:01 pm

Re: Simple Remote Desktop

Post by Etayson »

Kwai chang caine wrote: Tue Feb 18, 2025 7:55 pm They are several days i try (without real succes i must recognize :oops: ) to understand this splendid code, because like i already say, this subject interest me at the higher point since decades 8)
-snip-
in fact, the image transfer is not slow because you transfer only the part that has changes.
The remote PC screen is divided into many small rectangles and at each cycle a check is made to see if the image in this rectangle has changed, if so, it is entered into the area for data transfer. Then this area is compressed using JPEG (that is why there are artifacts) and transferred. All this happens in the MakeScreenshot procedure. And on the receiving PC everything happens in the reverse order in the addPart procedure. The transferred data is unpacked into rectangles and inserted into the desired part of the image.
Thus, if there are no changes, then nothing is transferred except for service information in a small volume.
The transfer speed, as well as the volume of data, approximately corresponds to the program anydesk, but there are no lags.
Last edited by Etayson on Sun Feb 23, 2025 6:08 pm, edited 1 time in total.
Etayson
Enthusiast
Enthusiast
Posts: 110
Joined: Sun Jun 05, 2016 5:01 pm

Re: Simple Remote Desktop

Post by Etayson »

Kwai chang caine wrote: Fri Feb 21, 2025 8:11 pm I'm forcing to create a virtual server in my box for the machine who have the server, i don't know if it's normal ? :oops:
If your machines are on the same network, you can simply launch a server on any of them. And connect to it as clients.
Etayson
Enthusiast
Enthusiast
Posts: 110
Joined: Sun Jun 05, 2016 5:01 pm

Re: Simple Remote Desktop

Post by Etayson »

Skipper wrote: Thu Feb 06, 2025 2:02 pm What is the use case for this? Depending on platform, I use RDP and/or SSH and have some difficulty to understand what this is adding to that?

Cheers
Skipper
Firstly, RDP needs to be configured. I have computers on the network that I can ping, ports are open, RDP support is enabled, but I can't connect via RDP. I don't know what the reason is, maybe firewalls on WiFi routers don't allow it, maybe something else. And using Anydesk, for example, doesn't always give a good result, either they ask to buy a business license, or there are lags of several seconds. That's why the idea was born to write remote access program.
Post Reply