LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.

Overview

Build Status Build status Help making this possible Join the chat at https://gitter.im/LibVNC/libvncserver

LibVNCServer: A library for easy implementation of a VNC server. Copyright (C) 2001-2003 Johannes E. Schindelin

If you already used LibVNCServer, you probably want to read NEWS.

What is it?

VNC is a set of programs using the RFB (Remote Frame Buffer) protocol. They are designed to "export" a frame buffer via net: you set up a server and can connect to it via VNC viewers. If the server supports WebSockets (which LibVNCServer does), you can also connect using an in-browser VNC viewer like noVNC.

It is already in wide use for administration, but it is not that easy to program a server yourself.

This has been changed by LibVNCServer.

Projects using it

The homepage has a tentative list of all the projects using either LibVNCServer or LibVNCClient or both.

RFB Protocol Support Status

Security Types

Name Number LibVNCServer LibVNCClient
None 1
VNC Authentication 2
SASL 20
MSLogon 0xfffffffa
Apple ARD 30
TLS 18
VeNCrypt 19

Encodings

Name Number LibVNCServer LibVNCClient
Raw 1
CopyRect 2
RRE 3
CoRRE 4
Hextile 5
Zlib 6
Tight 7
Zlibhex 8
Ultra 9
TRLE 15
ZRLE 16
ZYWRLE 17
TightPNG -260

How to build

LibVNCServer uses CMake, which you can download here or, better yet, install using your platform's package manager (apt, yum, brew, macports, chocolatey, etc.).

You can then build via:

mkdir build
cd build
cmake ..
cmake --build .

Crypto support in LibVNCClient and LibVNCServer can use different backends:

  • OpenSSL (-DWITH_OPENSSL=ON -DWITH_GCRYPT=OFF)
    • Supports all authentication methods in LibVNCClient and LibVNCServer.
    • Supports WebSockets in LibVNCServer.
  • Libgcrypt (-DWITH_OPENSSL=OFF -DWITH_GCRYPT=ON)
    • Supports all authentication methods in LibVNCClient and LibVNCServer.
    • Supports WebSockets in LibVNCServer.
  • Included (-DWITH_OPENSSL=OFF -DWITH_GCRYPT=OFF)
    • Supports only VNC authentication in LibVNCClient and LibVNCServer.
    • Supports WebSockets in LibVNCServer.

Transport Layer Security support in LibVNCClient and LibVNCServer can use:

  • OpenSSL (-DWITH_OPENSSL=ON -DWITH_GNUTLS=OFF)
  • GnuTLS (-DWITH_OPENSSL=OFF -DWITH_GNUTLS=ON)

For some more comprehensive examples that include installation of dependencies, see the Unix CI and Windows CI build setups.

Crosscompiling from Unix to Android

See https://developer.android.com/ndk/guides/cmake.html as a reference, but basically it boils down to:

mkdir build
cd build
cmake .. -DANDROID_NDK=<path> -DCMAKE_TOOLCHAIN_FILE=<path> -DANDROID_NATIVE_API_LEVEL=<API level you want>
cmake --build .

Crosscompiling from Linux to Windows

Tested with MinGW-w64 on Debian, which you should install via sudo apt install mingw-w64. You can make use of the provided toolchainfile. It sets CMake to expect (optional) win32 dependencies like libjpeg and friends in the deps directory. Note that you need (probably self-built) development packages for win32, the -dev packages coming with your distribution won't work.

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-mingw32-linux.cmake ..
cmake --build .

How to use

See the LibVNCServer API intro documentation for how to create a server instance, wire up input handlers and handle cursors.

In case you prefer to learn LibVNCServer by example, have a look at the servers in the examples directory.

For LibVNCClient, examples can be found in client_examples.

Using Websockets

You can try out the built-in websockets support by starting the example server from the webclients directory via ../examples/example. It's important to not start from within the examples directory as otherwise the server program won't find its HTTP index file. The server program will tell you a URL to point your web browser to. There, you can click on the noVNC-Button to connect using the noVNC viewer git submodule (installable via git submodule update --init).

Using Secure Websockets

If you don't already have an SSL cert that's trusted by your browser, the most comfortable way to create one is using minica. On Debian-based distros, you can install it via sudo apt install minica, on MacOS via brew install minica.

Go to the webclients directory and create host and CA certs via:

cd webclients
minica -org "LibVNC" $(hostname)

Trust the cert in your browser by importing the created cacert.crt, e.g. for Firefox go to Options->Privacy & Security->View Certificates->Authorities and import the created cacert.crt, tick the checkbox to use it for trusting websites. For other browsers, the process is similar.

Then, you can finally start the example server, giving it the created host key and cert:

../examples/example -sslkeyfile $(hostname).key -sslcertfile $(hostname).crt

The server program will tell you a URL to point your web browser to. There, you can click on the noVNC-encrypted-connection-button to connect using the bundled noVNC viewer using an encrypted Websockets connection.

Commercial Use

At the beginning of this project Dscho, the original author, would have liked to make it a BSD license. However, it is based on plenty of GPL'ed code, so it has to be a GPL.

The people at AT&T worked really well to produce something as clean and lean as VNC. The managers decided that for their fame, they would release the program for free. But not only that! They realized that by releasing also the code for free, VNC would become an evolving little child, conquering new worlds, making its parents very proud. As well they can be! To protect this innovation, they decided to make it GPL, not BSD. The principal difference is: You can make closed source programs deriving from BSD, not from GPL. You have to give proper credit with both.

Now, why not BSD? Well, imagine your child being some famous actor. Along comes a manager who exploits your child exclusively, that is: nobody else can profit from the child, it itself included. Got it?

What reason do you have now to use this library commercially?

Several: You don't have to give away your product. Then you have effectively circumvented the GPL, because you have the benefits of other's work and you don't give back anything. Not good.

Better: Use a concept like MySQL. This is free software, however, they make money with it. If you want something implemented, you have the choice: Ask them to do it (and pay a fair price), or do it yourself, normally giving back your enhancements to the free world of computing.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

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. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Contact

Issues
  • LibVNCClient cleanup: prefix with

    LibVNCClient cleanup: prefix with "rfbClient"

    ...and make sure it does not deliberately die() or exit() anywhere

    Item taken from https://github.com/LibVNC/libvncserver/blob/99842d5e8bf6577ef431217b791974497a229e21/TODO.md

    enhancement rework-api 
    opened by bk138 0
  • make SDLvncviewer more versatile

    make SDLvncviewer more versatile

    • [ ] test for missing keys (especially "[]{}" with ./examples/mac),
    • [ ] map Apple/Linux/Windows keys onto each other,
    • [ ] handle selection
    • [ ] handle scroll wheel
    • [ ] teach SDLvncviewer about CopyRect...

    Item taken from https://github.com/LibVNC/libvncserver/blob/99842d5e8bf6577ef431217b791974497a229e21/TODO.md

    feature-request 
    opened by bk138 0
  • Handle HTTP for threaded server

    Handle HTTP for threaded server

    If you'd like to put out an incentive for implementing this feature, you can do so at https://issuehunt.io/r/LibVNC/libvncserver

    Is your feature request related to a problem? Please describe.

    The embedded HTTP server code is not executed at all when the library runs in threaded mode.

    Describe the solution you'd like

    Working HTTP server when the library runs in threaded mode.

    Describe alternatives you've considered

    None.

    Additional context

    https://github.com/LibVNC/libvncserver/blob/master/libvncserver/main.c#L623

    feature-request 
    opened by bk138 0
  • [Feature request] Add automatic python3 bindings for the library

    [Feature request] Add automatic python3 bindings for the library

    If you'd like to put out an incentive for implementing this feature, you can do so at https://issuehunt.io/r/LibVNC/libvncserver

    Is your feature request related to a problem? Please describe.

    I would like to use a vnc library in python, and re-writing one from scratch seems overkill. There aren't great alternatives in that language.

    Describe the solution you'd like

    By creating automatic python bindings from this library, you cover two languages with one. Plus maybe lay ground work for more later on.

    Describe alternatives you've considered

    RealVNC is the only library with python bindings I can find, and is very expensive. Strict python libraries like vncdotool are for automating cli tasks, and don't have all the necessary features. Everything else I can find is either closed source and don't support python (TightVNC sdk), or has a small community behind it.

    Additional context

    If this library turns out to be the best route for my project, I'd be willing to take a stab at implementing this over my weekends, if it's something you're interested in.

    feature-request 
    opened by Cameronsplaze 10
Releases(LibVNCServer-0.9.13)
  • LibVNCServer-0.9.13(Jun 13, 2020)

    0.9.13 truly is a cross-platform release, the best we've ever done in that respect: Out of the 49 issues closed with this release, 20 alone were related to MS Windows. The result is that 0.9.13 is the first release with full support for Microsoft Windows! The cross-platform focused work did not end there tough: MacOS support was brought up from barebones to a fully working production-grade VNC server application. Other highlights are improvements regarding TLS in LibVNCClient, SetDesktopSize support in LibVNCServer and a major cleanup of the project's documentation. Last but not least, 0.9.13 comes with the usual assortment of bugfixes and security improvements.

    Overall changes:

    • Small tweaks to the CMake build system.
    • The macOS server example was overhauled and is now the most feature-complete sample application of the project, ready for real-world use.
    • Lots of documentation updates and markdownifying.
    • The TravisCI continuous integration now also build-checks cross-compilation from Linux to Windows.
    • Setup a Gitter community chat for the project.

    LibVNCServer/LibVNCClient:

    • Both LibVNCServer and LibVNCClient now support an additional platform, namely Microsoft Windows. Building is supported with Visual Studio as well as MingGW.
    • The separate crypto routines used by LibVNCClient and LibVNCServer were refactored into an implementation common to both libraries.
    • Several security issues got fixed, namely:
      • CVE-2018-21247: When connecting to a repeater, only send initialised string
      • CVE-2019-20839: libvncclient: bail out if unix socket name would overflow
      • CVE-2019-20840: fix crash because of unaligned accesses in hybiReadAndDecode()
      • CVE-2020-14396: libvncclient/tls_openssl: do not deref a NULL pointer
      • CVE-2020-14397: libvncserver: add missing NULL pointer checks
      • CVE-2020-14398: libvncclient: handle half-open TCP connections
      • CVE-2020-14399: libvncclient: fix pointer aliasing/alignment issue
      • CVE-2020-14400: libvncserver: fix pointer aliasing/alignment issue
      • CVE-2020-14401: libvncserver: scale: cast to 64 bit before shifting
      • CVE-2020-14402: libvncserver: encodings: prevent OOB accesses
      • CVE-2020-14403: encodings: prevent OOB accesses
      • CVE-2020-14404: libvncserver: encodings: prevent OOB accesses
      • CVE-2020-14405: libvncclient/rfbproto: limit max textchat size
    • The bundled noVNC client is now at version 1.1.0 and included via a git submodule.

    LibVNCClient:

    • Added connect timeout as well as read timeout support thanks to Tobias Junghans.
    • Both TLS backends now do proper locking of network operations when multi-threaded thanks to Gaurav Ujjwal.
    • Fixed regression in Tight/Raw decoding introduced in 0.9.12 thanks to DRC.
    • Fixed encrypted connections to AnonTLS servers when using the OpenSSL back-end. Made possible by the profound research done by Gaurav Ujjwal.

    LibVNCServer:

    • Added a hooking function (clientFramebufferUpdateRequestHook) to deliver rfbFramebufferUpdateRequest messages from clients to the frame producer thanks to Jae Hyun Yoo.
    • Added SetDesktopSize/ExtendedDesktopSize support thanks to Floris Bos.
    • Added multi-threading support for MS Windows.
    • Fixed VNC repeater/proxy functionality that was broken in 0.9.12.
    • Fixed unstable WebSockets connections thanks to Sebastian Kranz.
    Source code(tar.gz)
    Source code(zip)
  • LibVNCServer-0.9.12(Jan 6, 2019)

    • Overall changes:

      • CMake now is the default build system, Autotools were removed.
      • In addition to TravisCI, all commits are now build-tested by AppVeyorCI.
    • LibVNCServer/LibVNCClient:

      • Numerous build fixes for Visual Studio compilers to the extent that one can now build the project with these. The needed changes for successfully running stuff will be implemented in 0.9.13.
      • Fixed building for Android and added build instructions.
      • Removed the unused PolarSSL wrapper.
      • Updated the bundled noVNC to latest release 1.0.0.
      • Allowed to use global LZO library instead of miniLZO.
    • LibVNCClient:

      • Support for OpenSSL 1.1.x.
      • Support for overriding the default rectangle decode handlers (with hardware-accelerated ones for instance) thanks to Balazs Ludmany.
      • vnc2mpg updated.
      • Added support for X509 server certificate verification as part of the handshake process thanks to Simon Waterman.
      • Added a TRLE decoder thanks to Wiki Wang.
      • Included Tight decoding optimizations from TurboVNC thanks to DRC.
      • Ported the SDL viewer from SDL 1.2 to SDL 2.0.
      • Numerous security fixes.
      • Added support for custom auth handlers in order to support additional security types.
    • LibVNCServer:

      • Websockets rework to remove obsolete code thanks to Andreas Weigel.
      • Ensured compatibility with gtk-vnc 0.7.0+ thanks to Michał Kępień.
      • The built-in webserver now sends correct MIME type for Javascript.
      • Numerous memory management issues fixed.
      • Made the TightVNC-style file transfer more stable.
    Source code(tar.gz)
    Source code(zip)
  • LibVNCServer-0.9.11(Dec 30, 2016)

    • Overall changes:
      • LibVNCServer/LibVNCClient development now uses continous intregration, provided by TravisCI.
    • LibVNCClient:
      • Now initializes libgcrypt before use if the application did not do it. Fixes a crash when connection to Mac hosts (https://github.com/LibVNC/libvncserver/issues/45).
      • Various fixes that result in more stable handling of malicious or broken servers.
      • Removed broken and unmaintained H264 decoding.
      • Some documentation fixes.
      • Added hooks to WriteToTLS() for optional protection by mutex.
    • LibVNCServer:
      • Stability fixes for the WebSocket implementation.
      • Replaced SHA1 implementation with the one from RFC 6234.
      • The built-in HTTP server does not allow directory traversals anymore.
      • The built-in HTTP now sends correct MIME types for CSS and SVG.
      • Added support for systemd socket activation.
      • Made it possible to get autoPort behavior with either ipv4 or ipv6 disabled.
      • Fixed starting of an onHold-client in threaded mode.
    Source code(tar.gz)
    Source code(zip)
  • LibVNCServer-0.9.10(Oct 21, 2014)

    • Overall changes:
      • Moved the whole project from sourceforge to https://libvnc.github.io/.
      • Cleaned out the autotools build system which now uses autoreconf.
      • Updated noVNC HTML5 client to latest version.
      • Split out x11vnc sources into separate repository at https://github.com/LibVNC/x11vnc
      • Split out vncterm sources into separate repository at https://github.com/LibVNC/vncterm
      • Split out VisualNaCro sources into separate repository at https://github.com/LibVNC/VisualNaCro
      • Merged Debian patches.
    • LibVNCServer/LibVNCClient:
      • Fixed some security-related buffer overflow cases.
      • Added compatibility headers to make LibVNCServer/LibVNCClient build on native Windows 8.
      • Update LZO to version 2.07, fixing CVE-2014-4607.
    • LibVNCServer:
      • Merged patches from KDE/krfb.
      • Can now do IPv6 without IPv4.
      • Fixed a use-after-free issue in scale.c.
    Source code(tar.gz)
    Source code(zip)
Owner
Cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
null
Linux Terminal Service Manager (LTSM) is a set of service programs that allows remote computers to connect to a Linux operating system computer using a remote terminal session (over VNC or RDP)

Linux Terminal Service Manager (LTSM) is a set of service programs that allows remote computers to connect to a Linux operating system computer using a remote terminal session (over VNC)

null 14 Jan 5, 2022
Minimalistic server (written in C) and a python3 client to allow calling C function on a remote host

Minimalistic server (written in C) and a python3 client to allow calling C function on a remote host

null 8 Jun 1, 2022
SimpleSockets is a lightweight set of classes that allow developers to implement IP based network programs.

------------------------------------------------------------------------------------------ * History -------------------------------------------------

DFHack 139 May 29, 2022
single header C(99) library to implement client-server network code for games

single header C(99) library to implement client-server network code for games

Nathan 217 Jun 16, 2022
About Add any Program in any language you like or add a hello world Program ❣️ if you like give us ⭐

Hello-World About Add any Program in any language you like or add a hello world Program ❣️ if you like give us ⭐ Give this Project a Star ⭐ If you lik

Lokesh Jangid 16 Jan 22, 2022
Triton Python and C++ client libraries and example, and client examples for go, java and scala.

Triton Client Libraries and Examples To simplify communication with Triton, the Triton project provides several client libraries and examples of how t

Triton Inference Server 141 Jun 24, 2022
Simple useful interoperability tests for WebRTC libraries. If you are a WebRTC library developer we'd love to include you!

Overview This project aims to be a convenient location for WebRTC library developers to perform interoperability tests. Who can Participate The projec

Aaron Clauson 91 Jun 22, 2022
A beginner friendly Client-Server program in C. Socket Programming in C

basic-client-server Program on basic client-server connection. This is intended to whomever it may be useful. If you use this somewhere else, proper r

Abdul Samad 1 Oct 21, 2021
Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services.

Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack.

Fanout 3.1k Jun 22, 2022
Online chess platform (client-server) in Python with StockFish API

PyChess Gra w szachy tylko w Pythonie :) Wymagania Python 3.8 Instalacja Wchodzimy i pobieramy najnowsze wydanie aplikacji. https://github.com/Rafixe

Rafał Hrabia 6 Oct 7, 2021
Ole Christian Eidheim 735 Jun 24, 2022
A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio.

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.

Ole Christian Eidheim 2.3k Jun 22, 2022
Now get your alerts & updates about home, wherever you are, with an SMS on your mobile! All with a simple NodeMCU project!

Now get your alerts & updates about home, wherever you are, with an SMS on your mobile! All with a simple NodeMCU project!

Priyanka Peddinti 2 Oct 20, 2021
A cross-platform HTTP client library with a focus on usability and speed

EasyHttp A cross-platform HTTP client library with a focus on usability and speed. Under its hood, EasyHttp uses POCO C++ Libraries and derives many o

Sony 141 Jun 17, 2022
Tiny cross-platform HTTP / HTTPS client library in C.

naett /nɛt:/ Tiny HTTP client library in C. Wraps native HTTP client functionality on macOS, Windows, Linux, iOS and Android in a single, simple non-b

Erik Agsjö 13 Jun 21, 2022
Cross-platform, efficient, customizable, and robust asynchronous HTTP/WebSocket server C++14 library with the right balance between performance and ease of use

What Is RESTinio? RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server. It is based on standalone version of ASIO

Stiffstream 863 Jun 23, 2022
A cross-platform network learning demos. Like high-performance http server

Network-Learn A cross-platform network learning demos (toys). And I try not to use 3rd-party libraries. Welcome to try it out and leave your comments.

Ho 229 24 Apr 15, 2022
Cross-platform, single .h file HTTP server (Windows, Linux, Mac OS X)

EWS - Single .h File C Embeddable Web Server Latest Version: 1.1.4 released September 9, 2021 Supported platforms: Linux, Mac OS X, Windows License: B

Forrest Heller 75 May 18, 2022
LANDrop is a cross-platform tool that you can use to conveniently transfer photos, videos, and other types of files to other devices on the same local network.

LANDrop is a cross-platform tool that you can use to conveniently transfer photos, videos, and other types of files to other devices on the same local network.

LANDrop 2.8k Jun 20, 2022