Share My Creation VNC Server & Client : Source Code For Sale

Hello everyone :)

*Stating off by thanking @Erel for making this possible for every single one of us ♥

We were requested numerous times to create VNC server & client in B4X technology, so here we are :)

In exactly 2 weeks the project will be ready and released (17-05-2021 11:00 PM GMT 3+).

System overview :

The Server side setup the server IP and port (Usually 5900 but changeable) and allow the incoming and outgoing connections requests.
The Client side enters the Server IP and Port and the connection will start right away.
Once the connection has been established, the client is able to full control the server side (host) by transmitting the Keyboard, Mouse, Screen Capture, etc...

Yup, as simple as that.

Why this is more powerful than the Teamviewer Alternative :
1-Each session data is real time, meaning unlike Teamviewer alternative project there won't be any database, JRDC2, etc...
2-No extra setup and complicated steps, just open the port and you are ready to go.
3-Faster Connections because there won't be any extra tunneling (JRDC2 and MS SQL)
4-Full HD
5-and the list goes on...

Future Updates :
1- B4A Client, the android client will be able to fully control the server side (host) Done :)
2- File Transfer
3- Able to use any VNC viewer to view the Server side (Host) Done :)
4- Hidden Mode/Stealth Mode
5- B4A VNC Server Done :)

Technology used:
Purely developed in B4J, no external software and external SDKs

Future Technology will be used is B4A which will also be purely developed in B4A only.

Notes :
-For the past 48 hours we have developed the proof of concept and it's working great, full HD, fast, and does what it should which is controlling the remote server side (Host)
-Also we have tested it using RealVNC viewer and it connected to the B4J VNC Server

*If you would like to add any feature please write in this post and we will add them in the next update :)



If you would like to use a small demo of B4J Server & B4J Client please use the below download link (Copy & Paste the URL in your browser) :

Demo notes :
1- B4J Server : We have connected to it using B4J Client + UltraVNC viewer
2- B4J Client : We have connected to B4J Server + UltraVNC Server


B4A VNC Server ! :

B4A VNC Viewer :

To purchase the source codes click on the link below :


As always, Thank You,
Saif
 

Attachments

  • fs-payment1 (1).png
    fs-payment1 (1).png
    43.2 KB · Views: 12,048
Last edited:

sfsameer

Expert
Licensed User
Longtime User
First, thank you for reading my post and I totally understand that a "proxy" function will not be part of the first release of this new VNC source code.

I do want to just express a few thoughts for when you do add the proxy feature...

I understand when you talk about automatically setting up new rules for a firewall, or using a VPN to connect the host and viewer together. But I think these methods will require either a configurable firewall or require the user to manually setup and install a VPN - both of which may not work easily over a cellular connection.

This is how I hope the "proxy" feature will work:

1) The end user will simply run a "host" app on their device which will then display some unique connection "code".
2) I will enter that connection code into the "viewer" app running on my phone and then I can connect and see/control the user's device even if we both are on a cellular network.

It would be great if everything could work just that simple (no firewall rules, no vpn needed). This way I can Easily offer Immediate support to my clients without them having to jump through hoops to setup anything.
Hello Dear,

Because we have started the updates loop so i have 2 questions if i may regarding the public remote connection without setting up the router :
1- Should we use the same method as the TVA which is a middle ware server that transmits the connection data between clients through web sockets?
2- Should we use a proxy server to enable both parties to connect to each other without the need to open a port in the router?

Note : Option 1 & Option 2 will need a middle ware server to receive and send requests.

Thank you,
Saif
 

JohnC

Expert
Licensed User
Longtime User
Hello Dear,

Because we have started the updates loop so i have 2 questions if i may regarding the public remote connection without setting up the router :
1- Should we use the same method as the TVA which is a middle ware server that transmits the connection data between clients through web sockets?
2- Should we use a proxy server to enable both parties to connect to each other without the need to open a port in the router?

Note : Option 1 & Option 2 will need a middle ware server to receive and send requests.

Thank you,
Saif
Before I answer your above question, I would like to first reiterate the three use-cases that I hope the next update can support:

1) The first use-case is to have both the host and server support "reverse connections". For example, I could setup port-forwarding on my office pc so it will route "incoming connections" on a particular port from external "hosts" app to my PC. Then I would run the "viewer" app in reverse connection mode so it is waiting for an incoming connection from a "host" app. Since I have control over my end of the connection, it is easy to setup this port-forwarding in my router.

Then, I would create a custom version of the host app that would be hard-coded to make a reverse connection to the IP address of my office pc. This would then allow my client to simply run the custom host app and connect to my waiting viewer app - allowing me to support them immediately.

I am only mentioning this use-case because I hope the next update for your host and viewer apps can support reverse connections so that they can connect to each other without the need for any "middleware" (just as VNC is designed to do).

Next, I can see at least two different use-cases where middleware would be needed:

2) I have a bunch of remote (and unattended) PC's that I need to remotely maintain (which I am looking to change to android devices soon). I am hoping that the next update of your host and viewer can operate in a mode that uses a middleware server that would allow a viewer app running on my PC to connect to any of those remote pc's at any time. So, I am thinking that I would configure each of the remote PC's to auto-load your host app to run it when the PC boots up. These host apps would then contact the middleware server every 10 seconds or so to let the middleware server know that the pc is available to be connected to. Then the viewer app would have the ability to connect to the middleware server and get a list of all the available pcs that can be connected to. Then all I would have to do is click on a host PC name and my viewer app will connect to the remote host app and allow me to control it.

In this configuration, I'm thinking that it would be best to not require any routers to be pre-configured with port forwarding, so that the host and viewer app can connect to each other even if both ends have dynamic IP addresses and also that they may not have the ability to configure their firewall/router at all.

3) The final use-case is the ability for me to be able to still support one of my clients when I am not back at my office. In this situation, it would not be practical for the clients host app to be hard coded to make a reverse connection to a fixed IP address because my portable PC or smartphone device will probably be using a connection with a dynamic IP address. In this use-case, middleware will be needed to connect the client's host app to my viewer app.

Maybe the host app could allow the client to type in their name when they first run the host app and their name will appear in the list of the available devices that my viewer app will list as available to connect to, just like the above #2 use-case. I could then click on their name and my viewer app would be connected to their host app.

I just wanted to mention the above use-cases so that they might help give you ideas for the next update of this project.

Now, to answer your question....I think it would be best to:

1) Design the middleware to utilize a database but only for the purpose of managing what devices are available to connect to.
2) Then when I click on a host device to connect to, the middleware will then act as a proxy to route the packets between the host and viewer directly to each other without any overhead (like going through a database like the TVA did).

I hope all this makes sense and I am very much looking forward to the next update!
 

sfsameer

Expert
Licensed User
Longtime User
Before I answer your above question, I would like to first reiterate the three use-cases that I hope the next update can support:

1) The first use-case is to have both the host and server support "reverse connections". For example, I could setup port-forwarding on my office pc so it will route "incoming connections" on a particular port from external "hosts" app to my PC. Then I would run the "viewer" app in reverse connection mode so it is waiting for an incoming connection from a "host" app. Since I have control over my end of the connection, it is easy to setup this port-forwarding in my router.

Then, I would create a custom version of the host app that would be hard-coded to make a reverse connection to the IP address of my office pc. This would then allow my client to simply run the custom host app and connect to my waiting viewer app - allowing me to support them immediately.

I am only mentioning this use-case because I hope the next update for your host and viewer apps can support reverse connections so that they can connect to each other without the need for any "middleware" (just as VNC is designed to do).

Next, I can see at least two different use-cases where middleware would be needed:

2) I have a bunch of remote (and unattended) PC's that I need to remotely maintain (which I am looking to change to android devices soon). I am hoping that the next update of your host and viewer can operate in a mode that uses a middleware server that would allow a viewer app running on my PC to connect to any of those remote pc's at any time. So, I am thinking that I would configure each of the remote PC's to auto-load your host app to run it when the PC boots up. These host apps would then contact the middleware server every 10 seconds or so to let the middleware server know that the pc is available to be connected to. Then the viewer app would have the ability to connect to the middleware server and get a list of all the available pcs that can be connected to. Then all I would have to do is click on a host PC name and my viewer app will connect to the remote host app and allow me to control it.

In this configuration, I'm thinking that it would be best to not require any routers to be pre-configured with port forwarding, so that the host and viewer app can connect to each other even if both ends have dynamic IP addresses and also that they may not have the ability to configure their firewall/router at all.

3) The final use-case is the ability for me to be able to still support one of my clients when I am not back at my office. In this situation, it would not be practical for the clients host app to be hard coded to make a reverse connection to a fixed IP address because my portable PC or smartphone device will probably be using a connection with a dynamic IP address. In this use-case, middleware will be needed to connect the client's host app to my viewer app.

Maybe the host app could allow the client to type in their name when they first run the host app and their name will appear in the list of the available devices that my viewer app will list as available to connect to, just like the above #2 use-case. I could then click on their name and my viewer app would be connected to their host app.

I just wanted to mention the above use-cases so that they might help give you ideas for the next update of this project.

Now, to answer your question....I think it would be best to:

1) Design the middleware to utilize a database but only for the purpose of managing what devices are available to connect to.
2) Then when I click on a host device to connect to, the middleware will then act as a proxy to route the packets between the host and viewer directly to each other without any overhead (like going through a database like the TVA did).

I hope all this makes sense and I am very much looking forward to the next update!

Hello Dear,

You know what i love about talking to you? you are a very detailed person which makes our lives easier, so thank you for that ❤

1- Consider it done
2- Consider it done

--------
1- Consider it done
2- Consider it done

As always, Thank you,
Saif
 

Xfood

Expert
Licensed User
good morning Saif, I had the opportunity to try this splendid work you have done in these days, at the moment it is fantastic, I imagine that the next update will be amazing. Thanks Saif, keep it up.
 

Louis Moskowitz

Member
Licensed User
I would like to make a few suggestions for this new version, as well as help explain a few things that may not be clear:

With VNC you have a "host" and "viewer".

- The "Host" is the device that you want to view/control, so it is acting like a webserver. You could connect to the host like a browser connects to a webserver and the "Host" generate the screenshots like a webserver would generate webpages.

- The VNC "Viewer" is like a browser in the above example, you direct the vnc viewer to connect to a vnc host and then the viewer will show you the streaming screenshots from the host (and allow you to send keystrokes and mouse movement to the host device).

Typically to connect to a host, you just need the host's IP address and port number and password - that's is. You would then enter this info into the viewer and the viewer would connect to the host and then allow the viewer to see and control the host.

Often the host would be your client's PC or wireless device. However, their device might be behind a firewall or a cellphone network who's IP address often changes (and a lot of cellular companies don't allow "incoming" connections to cell phones). In these situations, it's not possible for the viewer to connect "to" the host.

Below are two problem scenarios (like the one just mentioned above) and my suggestions for addressing them that I hope sfsameer could consider for this next version:

1) "Variable" Host, "Fixed" viewer:

The "Host" (the client) is behind a firewall, or is running on a device with a changing IP (cell phone) and/or doesn't allow for incoming connections.

The "Viewer" (the support company, ie "Me") is a desktop PC with a fixed IP address and a firewall/router that can be configured to route incoming connections to the PC's viewer app.

Solution: Allow for the host and viewer apps to perform a "reverse connection". This way, the "viewer" on my PC would be configured to "listen" for an incoming connection from a host. Since my PC is at a fixed IP address, I can provide that address and the configured/forwarded port to the client so that they can enter it into their "host" app. The host app would make a connection into my viewer app and then I could see and control the client's device from my PC. This method eliminates the problem in which the host app can not accept incoming connections, but the viewer app can.

2) "Variable" Host, "Variable" Viewer:

The "Host" (the client) is behind a firewall, or the host is on a device with a changing IP (cell phone) and/or doesn't allow for incoming connections.

The "Viewer" is also behind a firewall, or running on a device who's IP address changes and/or doesn't allow incoming connection.

Solution: Setup a "Proxy" to connect the two to each other.

For this scenario, a proxy would be run on a cloud server and below is my suggestion on how it would work:

1) The "host" app would be designed to make short repeating connections every 5 second or so to this "proxy", basically telling the proxy that this particular host is ready for a connection.
2) The "Viewer" app would then connect to this proxy and the proxy will return a list of hosts that are ready for a connection to the viewer app. When I select a host from the list, the proxy will then return an IP address and port number that the viewer app will then use to connect to tat host. The proxy will then act as a true proxy and reroute all the packets from the viewer app to the host app and visa versa using the IP address and port number the proxy setup to do this exchange. It should route these packets directly between the input and output sockets without the use of a database - this way throughput will be maximum and server load be minimum.

By utilizing a "proxy" for this scenario, it would allow the client to run the host app on their smartphone over a cellular network, and then allow me to control (offer remote support) the client's device from my smartphone which is also operating over a cellular network.

I hope all this makes sense and I look forward to any comments on this.
Hi All.
I have made a similar suggestion to the developers in private and if they can solve this conundrum (host behind a firewall) we would truly have a a TeamViewer / AnyDesk RealVNC alternative. I would be happy to contribute to this kind of development. RealVNC offer this as a cloud service. See: https://www.realvnc.com/en/news/what-vnc-cloud/

Would anyone else contribute to some sort of "crowd funded development" for Saif and his team to tackle this?

Thanks
Louis
 

JohnC

Expert
Licensed User
Longtime User
I think they are already working on a "middleware" program that we will be able to run/host on our own web servers, so we would not need a third party cloud server.
 
Last edited:

jose luis gudino

Active Member
Licensed User
Longtime User
Future Updates :
1- B4A Client, the android client will be able to fully control the server side (host)
2- File Transfer
3- Able to use any VNC viewer to view the Server side (Host)
4- Hidden Mode/Stealth Mode

HI, how long will the new features be up and running?
Thank.
 

Louis Moskowitz

Member
Licensed User
I think they are already working on a "middleware" program that we will be able to run/host on our own web servers, so we would not need a third party cloud server.
Just to be clear, we would not be able to use the RealVNC cloud broker service, it is for their version. I was just sharing it as reference as to what we need Saif and his team to do to be able to have an alternative to RealVNC.

Great to hear that they are working on a solution.

Thanks
Louis
 

Louis Moskowitz

Member
Licensed User
Hello Dear,

You know what i love about talking to you? you are a very detailed person which makes our lives easier, so thank you for that ❤

1- Consider it done
2- Consider it done

--------
1- Consider it done
2- Consider it done

As always, Thank you,
Saif
Wow, I missed this. Totally agree that this is a very precise and clear description of what we need. Thanks Saif and team for undertaking to get 1 & 2 done.

Louis
 

amorosik

Well-Known Member
Licensed User
I still don't understand if this system can also be used for remote assistance from PCs to Android phones that are not manned
I mean, how do you know the network address of the phone?
And even if you know it, how do you start a connection from pc to phone?
Obviously I'm talking about a telephone connected only via the telephone data network
 

sfsameer

Expert
Licensed User
Longtime User
I still don't understand if this system can also be used for remote assistance from PCs to Android phones that are not manned
I mean, how do you know the network address of the phone?
And even if you know it, how do you start a connection from pc to phone?
Obviously I'm talking about a telephone connected only via the telephone data network
Hello,

Simply :
1-In a local connection you can connect both PC and Android through local IP address and port (Direct Connection)
2-In a public connection : We did this in Teamviewer alternative V1 & Web Control (TVA V2) where we do have a middle ware server (Non-UI B4J) that receives the packets (byteBuffer, inputs, gestures, etc...) and sends them to the receiving the point (Point A) , once point A receives the packets then it will send the response (Updated byteBuffer, etc...) to Point B and all of this information exchange will be in a loop until the connection is disconnected.

:)
 

ocalle

Active Member
Licensed User
Hi
In the interest of consulting, even with the version now released with B4x code you can access a remote pc knowing the public ip (and enabling the firewall) right?
ty in advance
 

sfsameer

Expert
Licensed User
Longtime User
Hi
In the interest of consulting, even with the version now released with B4x code you can access a remote pc knowing the public ip (and enabling the firewall) right?
ty in advance
Hello,

Yes, as soon as you activate the port in your firewall your PC will be exposed to the internet and the VNC client will be able to connect to the VNC server.

Thank you,
Saif
 

sfsameer

Expert
Licensed User
Longtime User
Hello Everyone :)

After Writing 9 classes from scratch, Wrapping 29 classes, The B4A VNC Viewer simple version is born :)
Currently it's only used to view the server, no inputs, gestures, etc.. just for viewing.

**But this is the first version which means there will be many more version coming very soon, because the most difficult part is over which is :
1- Connecting to the server socket
2- Establishing the handshake
3- Encrypting and decrypting the password using : androidx.security:security-crypto
4- Enabling the color mode 256 and reading the bytebuffer
5- etc... (and many many more steps to accomplish the connection & the viewing)


-Below is the viewing demo (Keep in mind that the viewing activity is set to landscape so in the video it shows very small but in reality it's in landscape mode) :


Or you can view the video from the below URL :


-You can use it to connect to any VNC server BTW and not just B4J VNC Server :)

Before downloading the source code you need to know that there are 3 important libraries :
1- #AdditionalJar: androidx.security:security-crypto So make sure you open B4A SDK manager to download it
2- #AdditionalJar: tink-android-1.6.0.jar So make sure you put it in the additional libraries folder
3- VNCB4AClient.jar & VNCB4AClient.xml Make sure to put them in your internal libraries folder

*Please use the same download link we sent you earlier to download the B4A VNC Version and you will see a new file under the name : "VNCB4AClient.zip"

One last thing, the connection and the viewing is established by 2 lines of code in B4A because everything is happening in the libraries :) :
B4X:
B4AVNCClient1.mainSettings(Main.ServerIP,Main.ServerPort,Main.ServerPassword)
    B4AVNCClient1.StartViewer(img1)


**The next update is coming very soon which will contain the B4A VNC Server, so stay tuned :)

Thank you,
Saif
 
Last edited:
Top