A fully featured VNC client written in golang
Go to file
2018-01-24 09:24:36 +02:00
.idea fixed dv encoders 2017-12-30 15:50:34 +02:00
.vscode name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoders name change now: vnc2video, 2018-01-12 04:56:55 +02:00
example more encodings in main 2018-01-22 07:12:35 +02:00
logger name change now: vnc2video, 2018-01-12 04:56:55 +02:00
.gitignore next steps 2017-06-13 01:52:07 +03:00
button_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
buttons.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
client.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
clientmessagetype_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
conn.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoding_atenhermon.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoding_copyrect.go added rre encoding (tested) 2018-01-20 13:20:07 +02:00
encoding_corre.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoding_cursor.go initial cursor support (just getting the image and location), not drawing correctly yet 2018-01-18 09:22:11 +02:00
encoding_desktopname.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoding_desktopsize.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoding_hextile.go initial cursor support (just getting the image and location), not drawing correctly yet 2018-01-18 09:22:11 +02:00
encoding_pointer_pos.go initial cursor support (just getting the image and location), not drawing correctly yet 2018-01-18 09:22:11 +02:00
encoding_raw.go added zlib encoding (tested) 2018-01-20 12:08:17 +02:00
encoding_rre.go added rre encoding (tested) 2018-01-20 13:20:07 +02:00
encoding_tight.go cleaning up 2018-01-22 06:54:38 +02:00
encoding_tightpng.go fixing up tightPng implementation so it might work (untested) 2018-01-22 07:10:23 +02:00
encoding_util.go added zrle 2018-01-24 09:24:36 +02:00
encoding_xcursor.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
encoding_zlib.go added zlib encoding (tested) 2018-01-20 12:08:17 +02:00
encoding_zrle.go added zrle 2018-01-24 09:24:36 +02:00
encoding.go fixed fill filter in tight encoding 2018-01-21 19:45:19 +02:00
encodingtype_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
fbs-connection.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
fbs-reader.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
handlers.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
image.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
key_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
keys.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
LICENSE name change now: vnc2video, 2018-01-12 04:56:55 +02:00
messages_aten.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
messages.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
pixel_format.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
README.md added zrle 2018-01-24 09:24:36 +02:00
security_aten.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
security_none.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
security_tight.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
security_vencryptplain.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
security_vnc.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
security.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
securitysubtype_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
securitytype_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
server.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
tightcompression_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00
tightfilter_string.go name change now: vnc2video, 2018-01-12 04:56:55 +02:00

A real wold implementation of vnc client for go

After searching the web for an vnc client in golang which is not a toy & support more than handshake + RAW encoding, I came up blank, so, I set out to write one myself.

The video encoding part means that something can be viewed, and since I don't really feel like writing GTK UIs in 2018 (plus VNC viewers are a dime a dozen), a video file will do. In actuality the images produced are go image structs and can easily be saved as JPEG, or displayed in any UI you want to create.

Encoding support:

  • Tight VNC
  • Hextile
  • ZLIB
  • CopyRect
  • Raw
  • RRE
  • ZRLE
  • Rich-cursor pseudo
  • Desktop Size Pseudo
  • Cursor pos Pseudo

Since go has no good client UI library I chose to encode video instead, but the code is fully functional as a rfb renderer and renders into golang native image.Image structs.

Video codec support:

  • x264 (ffmpeg)
  • dv8 (ffmpeg)
  • dv9 (ffmpeg)
  • MJpeg (native golnag)

Frame Buffer Stream file support

  • Supports reading & rendering fbs files that can be created by vncProxy
  • This allows recording vnc without the cost of video encoding while retaining the ability to have video later if the vnc session is marked as important.

About

It may seem strange that I didn't use my previous vncproxy code in order to create this client, but since that code is highly optimized to be a proxy (never hold a full message in buffer & introduce no lags), it is not best suited to be a client, so instead of spending the time reverting all the proxy-specific code, I just started from the most advanced go vnc-client code I found.

Most of what I added is the rfb-encoder & video encoding implementations, there are naturally some additional changes in order to get a global canvas (draw.Image) to render on by all encodings.

The code for the encodings was gathered by peeking at several RFB source codes in cpp & some in java, reading the excellent documentation in rfbproto, and a lot of gritty bit-plucking, pixel jogging & code cajoling until everything fell into place on screen.

I did not include tightPng in the supported encoding list since I didn't find a server to test it with, so I can't vouch for the previous implementation, If you have such a server handy, please check and tell me if it works.