perlVNC

This is just a pre-alpha version of a VNC server implementation in perl.

Introduction

Why VNC?
Well, VNC is great. no doubt about it. I use it daily.
Not only portable, but extermely thin client in nature, VNC allows me to remote control many differnet computers across the internet/intranet. Being free, and open-source, I immediately liked it better than other possible solutions.

Why perl?
Perl is powerfull, portable, and I like it. It allows my to accomplish complicated tasks far more easily than any other programming language.

why perlVNC?
The Idea hit me when I saw the rfbcounter example.
For quite a long time I've been looking for an easy way to implement a thin GUI client, which can remote-control programs across my intranet. It had to be portable, cross-platform, easily configured, powerfull enough to be useful, VERY thin client, and if possible, thin server too.

After seeing rfbcounter, I new i've hit the jackpot. all I needed was to learn the VNC protocol (open source is great...), and implement it in perl.
And So, here we are.

The Package

vncperl.tar.gz (7Kb)

How to use it?

Simply extract all the files to a directory (make sure you got the "VNC" sub directory too).
Then run "perl main.pl" or "perl life.pl"

main.pl is an example of perlVNC. It listens on port 5902 for a vncviewer client connection. Once connected, it displays a 50x50 blue screen. left-click on the screen, it will turn green with 2 sub-rects. right-click on the screen, it will turn back blue.


life.pl is a more complex example of perlVNC. it listens on port 5902 for a vncviewer client connection. Once connected, it displays a Game of Life board.
On the client side, you can:

  • Press "C" to clear the board
  • Press "R" to put random cells on the board
  • Press "S" to start/stop the simulation
  • Press Left-Click to set a cell
  • Press Right-Click to clear a cell
  • Too connect to both servers (life.pl & mail.pl), run "vncviewer [server_name]:2", so the client will connect to the second display (at port 5902)

    The Files

  • VNC/Codec.pm - Pixel Formats, Color convertions, RAW and RRE encoding
  • VNC/ServerConnection.pm - The main VNC state machine and message handling
  • VNC/Server.pm - Very simple TCP server
  • main.pl - First Example of using perlVNC
  • life.pl - "Game of Life" Example of using perlVNC
  • System Requirements:

    The perlVNC server should be able to run on any system with regular perl installed.
    Tested with Perl 5.6 on ppc-linux and ActivePerl 5.6.1 on w2k.

    TODO:

    Perl-wise:

  • Improve readbility of modules
  • Write 'well behaved' perl modules (croak, etc)
  • POD documentation
  • makefile.pl & and standard module installation files
  • remove 'dies' and 'prints' from the modules
  • Improve the 'server.pm' module
  • VNC-wise:

  • Implement DES password challange/response
  • Implement HexTile encoder in VNC/Codec.pm
  • Implement Zlib encoding in VNC/Coded.pm
  • Improve Idle subroutine intervals
  • Userness-wise:

  • Documentation and FAQ
  • More examples (at least more useful examples :-)
  • Add Text capabilities (like the draw_digit function in rfbcounter), for digits and letters
  • Add Graphics capabilities (encoding and sending a GIF/JPG/PNG/XPM whatever)
  • Testing, Testing and more Testing.
  • If you have suggestion, improvements, questions or requests, please email me

    This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.