Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Modified Repeater 2011 - Mirror Service (Win32 Build + Src)

This forum is for VNC related products | This means not only UltraVNC | It even is allowed to announce or describe commercial (and of course non-commercial) programs here (but not anywhere else in the forum)
Post Reply
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Modified Repeater 2011 - Mirror Service (Win32 Build + Src)

Post by shadowfax »

I've talked about this idea on another thread. If someone knows how to develop on PHP and wants to make a nice user interface for it, it would be great as I'm still developping the Quick Support modification.

What is the "Mirror Service".

Basically the repeater will connect to a URL when the repeater receives a new server/viewer connection or one of them is disconnected. It will also send a HTTP request when the repeater performs a server/viewer clean up.

In the settings window (Only through the GUI and not through the webui) you may set the mirror services as active, and setup an URL for the service. For example, the URL could be:

Code: Select all

http://YOUR_ISP_WEBSITE/distributer.php
The repeater will forge a HTTP GET request using this URL and appending the following parameters:
  • Action
  • Password
  • ID
  • port
..as a sample, the rsulting URL, including the forged parameters looks like:

Code: Select all

http://YOUR_ISP_WEBSITE/distributer.php?Action=ACTION_PERFORMED&Password=&ID=SERVER_VIEWER_ID&port=PORT_OF_REPEATER
port is always the listening port at the repeater to which viewers connect to.

Password is currently empty will be used in a future version.

ID The ID the server or the viewer has used to connect to the repeater. When we are cleaning servers or viewers the ID will be '0' (zero).

Action is the action that raised this HTTP request. Can be:
  • AddServer
  • AddViewer
  • RemoveServer
  • RemoveViewer
  • CleanServers
  • CleanViewers
The PHP script should capture the real IP address of the repeater sending the command. This way, the database holding the data would relate to an IP address. This means, CleanServers/CleanViewers should only affect the rows related to that repeater's IP address. This allows several repeaters to show up their connections. Thus allowing several repeaters with a centralized webUI (Although configuration of each repeater won't be available through this central website).

This mod will allow to manage several repeater connections from a single site.

This allows PHP/ASP developpers to use repeater data through PHP/ASP to develop central management web interfaces. Maybe add MIME-TYPES, NoVNC, JavaViewer, etc...

With the QuickSupport Module it would allow to forge a ultraVNC.ini file with unique IDs for all the repeaters.

Binary and sources are downloadable through:
http://www.megaupload.com/?d=YU7JV3VE

Please, if you develop a web UI for this new feature, post it in this thread so other users may make use of it. If you have any other idea to improve this feature comment it out here.

Best regards.
Last edited by shadowfax on 2011-04-26 13:21, edited 4 times in total.
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by shadowfax »

I've managed to develop a bit more the PHP script. The script is available at:
http://www.megaupload.com/?d=49O8KKVH

INSTALLATION

Extract the file contents (except README.txt and database.sql) to your web server. Then edit both uvnc.php and repeater/index.php to set the $connectionString variable with your MySQL settings. Finally create a .htaccess and .htpasswd to protect your repeater directory. Create the database defined in database.sql/i].

FEATURES

uvnc.php is the file used to synch the repeater and the website and it should remain unprotected.

If you enter the repeater directory you'll get a list of the available repeaters (with no assigned viewer). At the right you get to icons... One of them will send a .vnc file with MIME type application/x-vncviewer so, if the vnc extension is properlly set it should open the ultra vnc viewer to that server (This is untested as I haven't been able to register properlly the extension in Windows Vista).

The second icon will open the ultraVNC Java Viewer to the selected server. This option has been tested and works fine :) If someone wants the source to the modified Java viewer I've uploaded it to:
http://www.megaupload.com/?d=7V0ENKYB
(Based on the version at sourceforge's SVN)

Once again, if anyone wants to tweak the PHP scripts and get a better user interface, maybe even tabbed windows using AJAX, or so on... It would be greate if you published this work on the thread.

Here is a small screen capture of the QuickSupport application ([topic=27995][/topic]) over the PHP service stored on an external HTTP server and synched by the modified repeater. That is the website you're seeing is NOT hosted on the same machine as the repeater. Will work with the original UltraVNC or SC, so the QuickSupport application is optional:
Image


Hope you like this mod. Feedback would be appreciated.
Last edited by shadowfax on 2011-04-26 14:03, edited 3 times in total.
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by shadowfax »

I wish people would reply to this post:

I've compiled a new version of the Repeater this time using LibCurl instead of my own HTTP function. The resulting executable file size is 336.896 byte vs 144.384 bytes of the previous version. LibCurl has been statically linked.

I've removed some protocols, although HTTP and FTP has been enabled.

I find the file size increment is quite high to keep it in mind, specially since a port to Linux -in order to run from a ReadyNAS or a router, could be critical. However, with OpenSSL it would support HTTPS (I find this interesting enough), it shall support password protected sites, and it would support FTP.

HTTP and/or FTP access could allow the repeater downloading a centralized configuration file. Personally I prefer HTTP as you could send different configuration files to different repeaters using a scripting language.

So, is the file size increase reasonabale just to throw libcurl into the project?

Would you vote for the first method (The one implemented right now) or shall I include libCurl into de repeater?

Best regards, and thankyou in advance for choosing your desired method.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by Rudi De Vos »

Look i nice mod....
Can you also run it on a apache win32 server ?
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by B »

I would vote for larger file size (336K is still pretty small), more functionality, and http rather than ftp.
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by shadowfax »

Sure :) It just relies on the standard HTTP protocol, so it would be independent of the platform the HTTP server is running on.

I have the repeater running on my Windows Laptop, and the PHP script is hosted on my ISP's server.

The only requirement is that the server allows some kind of scripting or programming in order to save the data received from the repeater. The server can be hosted locally or remotelly. It can be an Apache server running on Windows or Linux, an Internet Information Server, or any other variant such as BusyBox httpd (Which supports CGI).

The MODed repeater will only send a GET request to the server appending the parameter to the query. Imagine the PHP script is located at http://www.uvnc.com/uvnc.php

The repeater will do the same exact thing as if we wrote in the browser's address:

http://www.uvnc.com/uvnc.php?Action=Add ... 01&ID=1234

In a normal scenario this would open a web page... however, the script at our server shall process this information to store the data... In this case the repeater is telling us the repeater has Added a server with ID 1234. It also tells us the open port for viewers in this server is 5901. The only missing information is the address of the repeater BUT since it is the repeater the one that contacts the HTTP server, we can grab this address (For example $_SERVER['REMOTE_ADDR'] on an Apache with PHP installed, proxy detection is recomended and included on the sample PHP script).

The way the server replies to the repeater is through the HTTP reply code. That is, if the server response is "OK" (code 200) the repeater knows everything went ok, in any other case the repeater will log an error. In my sample I've used error code 404 as a way of hiding the script from peeping eyes if the resquest is invalid and Internal servel Error (Code 500) when there is a problem with the database for debugging the script.

The way I make the request is as simple as it gets... For example, if our doamin is redirected it wont work, as the first code received would be in the range of 300-399 (Redirect codes). That's where libCurl comes handy, as implementig this redirects would take some time and libCurl already takes care of it.

Also, as you may expect, a user could write the correct url in their browser window. For example, if a arite the same URL on my browser you would see my IP address added to you list with ID 1234... To avoid this things happening it would be nice that the repeater connected to a password protected site... Even more coding of the HTTP protocol and libCurl already takes care of it.

Even more, compiled with OpenSSL it could support HTTPS. However, libCurl is a big library and file size increases... My first option was to use a ligther library as libwww (from W3C) but it makes use of Regular Expresions and suggests GNU regexp ported to windows, but the download link won't go and, if it did, I've read several comments that states it's old and throws problems... So I went back to what I consider the most common opensource library: libcurl (although it is a bit bloated for such "simple" functionality. This, however, is not yet implemented on the code I've submitted so far. I'll send a copy of the project with LibCurl as soon as I've finished this post and clean up the large intelisense files VisualStudio produces.

This was an old idea I had while making the hack for the repeater to accept any VncViewer by using the password field as an ID. I thought it would be nice having the repeater notify my webserver whenever a connection had been made or destroyed. However due to lack of time I was unable to make the code for it.

As B pointed to me, some people would prefer a single app taking care of things intead of having a repeater AND a script hosted on a Web Server, that's why I left it as an option in the MODed repeater... However, the nice part is you'd be able to have several repeaters reporting to single site. For example, I once got a question about multiple computers connecting to a single repeater. To get a better view, you've got an office at Madrid with 20 computers, one at Barcelona with 10 computers, one at Toront with 20 computers, etc... The goal was connecting all of them to a single repeater. As you may imagine the network would suffer a great trafic. My idea around this issue would be to set a repeater at each site and some sort of repeater of repeaters (That can be worked through Modes)... however, the addition of the webUI -one thing I really wanted to see- brought back the old idea... As you wouldn't be able to access the webUI of multiple repeaters at once and checking several repeaters would take a long time. Here is one of the strong points of the MOD. Several repeaters could report their connections to a single website (If only one repeater is used and the user doesn't feel confortable with the scripting side, that's ok, he can use the new webUI).

Another thing it makes it interesting is that while not so many people know C/C++ programming (I consider my self a noob in C/C++) you can easily find people with knownledge on PHP/ASP/PERL or even JavaScript or HTML5. Leaving them the option to use whatever HTTP server and programming language to build the UI they wish would increase the richness of the project with new management sites, or even new viewers developped as WebApps.

One of my problems is I use VNC based apps for remote support... Kind of TeamViewers QuickSupport, and my repeater has several SPOF (single Points od Failure) therefore I could ask someone to turn my repeater on. If no one is there I could ask a friend to turn his repeater on. I wouldn't have to care where the repeater is located, as far as they enable my website on the repeater I would see the connections through my ISP address. This even helps my QuickSupport app, since all the connections are present at my ISP database, the website is able to generate random (but unique IDs) for one or several repeaters (I've also included HTTP support to the UltraVNC server so it can download a configuration file from the ISP server)... In a furue version of the script I my goal is to have registered users (They would get an static ID from the webserver) or a comon username for dynamic IDs.

Interaction between the repeater and a High Availability host such as those from ISPs add a bunch of new possibilities. For example, the server could contact the webserver asking if it is ok to add a server or viewers, and get a response from the http site telling it if it is ok or not. For example blacklisting, whitelisting, or schedules where one can connect or not. Altough all of this tasks cn be performed on pure C/C++, as I've stated before, there are more people with knowledge of PHP/ASP/PERL that could do the job pretty well, while the only programming on the repeater side would be a query and parse the response... right now just an OR or error but it could be enhanced with a JSON or XML parser giving even more flexibility to the script programming.

Glad you liked the MOD... It would be great to see it in an official repeater release :)
Last edited by shadowfax on 2011-04-27 22:45, edited 1 time in total.
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by shadowfax »

Repeater version using libCurl (sources only and libCurl included):
http://www.megaupload.com/?d=M2XTPMU9

In addition:

libCurl also alows other protocols as SMTP that could send an email to the administrator when a remote server connects to the repeater... and many other protocols... Reason why I wanted to stay away from it as it adds way too many protocols (And some aren't well documented on how to disbale them so the exe file doesn't increase in size)... Oh well... it opens a buch of possible new features... and the nice part is it is cross-compilable so the code may be reused if the reapeater is ported to linux :)
Last edited by shadowfax on 2011-04-27 22:42, edited 1 time in total.
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by redge »

shadowfax wrote:The goal was connecting all of them to a single repeater. As you may imagine the network would suffer a great trafic.
to break traffic to repeater and only initiate connection between server and client
nat2nat trough UDT of Rudi would be the best solution,
I waiting this very great feature to repeater2011 and to ultravnc and SC as native,

and i'm not worry anymore about my ISP complaint to me about network traffic and totally break cost 70 CHF/year web site hosting :-)

if Rudi read this,
how much money for "quick" and working adding nat2nat with UDT to repeater2011 would be amazing and break network cost of hosting repeater so everybody can use for free without worry since my repeater is for only home to home (business usage not allowed) and won't need true relay since firewall is less strong.

shadowfax,
if repeater can also run on simple http server like Synology would is it possible or if i can add to my router is much better.
Last edited by redge on 2011-04-28 20:22, edited 1 time in total.
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
shadowfax
40
40
Posts: 77
Joined: 2010-05-06 12:28
Location: Spain

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by shadowfax »

Maybe there is some misunderstanding about this modification... The repeater doesn't run on an web server. The repeater runs like the original UltraVNC 2011 repeater. The only difference is that it uses the standard HTTP protocol to update connection status to the repeater.

Basically you can mirror the repeater's web user interface on another HTTP server, such as an Apache Server running on your ISP. The repeater traffic will go through the server at which the repeater is installed on. It will just send a request to the HTTP/Web server in order to notify if a server or viewer has connected or disconnected to our repeater. But the actual VNC protocol won't go through our ISP server.

As a sample:

Server A connects to Repeater 1.
Repeater 1 notifies the external web server that Server 1 has connected.
Server B connects to repeater 2.
Repeater 2 notifies the external web server that Server 2 has connected.

A user connects to the web user interface of repeater 1 and sees only Server 1 is connected to the repeater.

The same user connects to the web user interface of repeater 2 and sees only Server B.

The user connects to its external host, or ISP host. He sees both servers are connected to the repeaters. With a single click he connects to Server A. The RFB traffic goes through Repeater 1. Until the server or viewer doesn't disconnect, or any other server or viewer connects, there is no more traffic to the HTTP server.

It has nothing to do with reducing RFB traffic, since NO RFB traffic goes through the HTTP server. The HTTP server is only a mirror of the web user interface. It is only a new user interface.

The script reciving the connect/disconnect messages can extend things up such as sending an email or SMS to a user notifying a server has connected (If of any use to them)... PHP/ASP/PERL are more widelly known than C/C++ so people could make extensions such as a web user interface with options as sending SMS. Emails, keeping connection logs, central managment of multiple repeaters, etc...

Othe cases... Imagine you are running an HTTP server on Synology that supports MySQL. Why open another port for the repeater web user interface? You could just use the mod to send notifies to the synology HTTP server and you would have the web user interface of the repeater running on Synologys HTTP server. Your router/firewall would open two ports towards the repeater (Same as the repeater version without web user interface) and another port to your synology's HTTP port.

It's not an HTTP repeater, it's just a way to get the web user interface of the repeater accesible on an external web server. When I say "external" I mean it's not coded into the repeater itself... It may be an HTTP server running on the same machine, on a machine on your LAN, or an external machine of your LAN.

I maintin my mirror copy on my ISP... Since I expect a low number of connections disconnections I guess the HTTP traffic will stay way lower than 100 Kb. I don't find that a great use of bandwith to my ISP... One again, it will only receive the notifications and it sill send a blank page back as a reply (The only important part is the response code. So the traffic is quite low. If you host that HTTP server, it won't interfer much.

Further more, if you have a repeater running at home just for personal use, and you got a repeater at work to help you with administration tasks... you could point both of them to your synology's HTTP server and this way you would see your home connections and the office connections in a single point. Or just imagine you wish to control your home PCs, and you have a vacational house... Instead of connecting them to the same repeater you can have one at each side, both pointed to your HTTP server. Traffic is low as you only get connect/disconnect notifications but NO RFB traffic is sent.

Using some symbology... It is like if you have a database of the connected servers and viewers, and a person is just watching your repeater and filling webforms at your HTTP server to keep you informed of who has connected or disconnected to your repeater. This way when you acces that page you can simply see al the information in a single window. Or because you just don't want to open an extra port and you already have an HTTP server and you asked someone to type all the data they see in the repeater webUI into the server for whom you have already opened a port.
Last edited by shadowfax on 2011-04-28 21:32, edited 2 times in total.
redge
1000
1000
Posts: 6797
Joined: 2004-07-03 17:05
Location: Switzerland - Geneva

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by redge »

Further more, if you have a repeater running at home just for personal use, and you got a repeater at work to help you with administration tasks... you could point both of them to your synology's HTTP server and this way you would see your home connections and the office connections in a single point. Or just imagine you wish to control your home PCs, and you have a vacational house... Instead of connecting them to the same repeater you can have one at each side, both pointed to your HTTP server. Traffic is low as you only get connect/disconnect notifications but NO RFB traffic is sent.
ok thank you so much for the clarification and very interesting functions.
I can't do for my office, i'm outsourced worker with very closed network
I use only for private usage.
UltraVNC 1.0.9.6.1 (built 20110518)
OS Win: xp home + vista business + 7 home
only experienced user, not developer
cheesekun
8
8
Posts: 9
Joined: 2011-03-19 04:32

Re: Modified Repeater 2011 - Mirror Service (Win32 Build + S

Post by cheesekun »

Anyone able to re upload now that MegaUpload is dead?
Post Reply