An RFB proxy, written in go that can save and replay FBS files
Go to file
2017-07-15 08:22:10 +03:00
.idea some work on the replay subsystem, plus getting better grasp of the FBS format 2017-07-14 00:52:50 +03:00
.vscode some work on the replay subsystem, plus getting better grasp of the FBS format 2017-07-14 00:52:50 +03:00
architecture some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
client some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
common cleaning up some old comments 2017-07-15 06:25:05 +03:00
encodings cleaning up some old comments 2017-07-15 06:25:05 +03:00
logger * some debugging and fixing in the proxy (still needs some work) 2017-07-11 16:50:06 +03:00
player some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
proxy some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
server some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
tee-listeners cleaning up some old comments 2017-07-15 06:25:05 +03:00
.gitignore added *.test to gitignore 2017-07-09 09:55:45 +03:00
LICENSE some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
main.go some more house cleaning, updated license & docs 2017-07-15 07:52:23 +03:00
README.md Update README.md 2017-07-15 08:22:10 +03:00
todo.md fixed recorder (message init logic broke it) 2017-07-12 01:06:02 +03:00
vncproxy.iml Added server for web sockets, plus some refactoring 2017-07-01 23:01:58 +03:00

VncProxy

An RFB proxy, written in go that can save and replay FBS files

  • supports all modern encodings
  • supports regular and sockified (noVnc) server connnections
  • produces FBS files compatible with tightvnc player
  • can also be used as:
    • a screen recorder vnc-client
    • a replay server to show fbs recordings to connecting clients

This is still a work in progress, and requires some error handling and general tidying up, but the code is already working (see server_test, proxy_test & player_test)

  • tested on tight encoding with: tightvnc (client+server), noVnc(web client), chickenOfTheVnc(client), vineVnc(server), tigerVnc(client)

Architecture

Proxy

Image of Arch

Communication to vnc-server & vnc-client are done in the RFB binary protocol in the standard ways. Internal communication inside the proxy is done by listeners (a pub-sub system) that provide a stream of bytes, parsed by delimiters which provide information about RFB message start & type / rectangle start / communication closed, etc. This method allows for minimal delays in transfer, while retaining the ability to buffer and manipulate any part of the protocol. For the client messages which are smaller, we send fully parsed messages going trough the same listener system. Currently client messages are used to determine the correct pixel format, since the client can change it by sending a SetPixelFormatMessage. Tracking the bytes that are read from the actual vnc-server is made simple by using the RfbReadHelper (implements io.Reader) which sends the bytes to the listeners, this helps avoid keeping track of each byte read, in order to write it into the recorder.

Encoding implementations do not decode pixel information, since this is not required for the proxy implementation.

This listener system was chosen over direct use of channels, since it allows the listening side to decide whether or not it wants to run in parallel, in contrast having channels inside the server/client objects which require you to create go routines (this creates problems when using go's native websocket implementation)

The Recorder uses channels and runs in parallel to avoid hampering the communication through the proxy.

Player

Image of Arch

The code is based on several implementations of go-vnc including the original one by Mitchell Hashimoto, and the very active fork which belongs to Vasiliy Tolstov.