libvncserver

LibVNCGPL-2.0活跃维护

跨平台 C 库,让你在自己的程序里快速实现 VNC 服务端或客户端功能,省去从零编写远程桌面协议的工作。

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

LibVNCServer-0.9.15发布于 2024-12-22 09:58 UTC1,371star577fork同步于 2026-11-10 11:48 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本LibVNCServer-0.9.15
  1. LibVNCServer-0.9.15最新正式版2024-12-22 · 2024-12-22 09:58 UTC

    0.9.15 sees some internal code structure cleanup, UTF-8 clipboard handling improvements and HTTP server support for multithreaded VNC servers. 27 issues and pull requests were closed/merged since 0.9.14.

    🕯 I'd like to dedicate this release to those affected by the 2024 Magdeburg car attack which happened two days ago. In these sad times, let's hope that all these alt-right AfD alternative-facts explainer news that are popping up right now (and their prominent supporters) don't get the upper hand in people's heads.

    Overall changes:

    • Added fuzzing with OSS-Fuzz thanks to Catena Cyber.
    • Improved build system to have files where they are expected in contemporary open source projects. Also split out Mac OS server example to own repo at https://github.com/LibVNC/macVNC
    • Added Windows CI on GitHub.

    LibVNCServer/LibVNCClient:

    • Fixed building with OpenSSL >= 3.0.0.
    • Fixed UTF-8 clipboard handling compatibility cases.

    LibVNCClient:

    • Fixed LibVNCClient handling of UltraVNC MSLogonII when built with OpenSSL.
    • Added UTF-8 clipboard handling.
    • Added API to allow the client to specify a subregion of the server's framebuffer and have LibVNCClient only ask for this, not the whole framebuffer.
    • Fixed Tight decoding endianness issues.
    • Added a Qt-based client example.

    LibVNCServer:

    • Added a proof-of-concept X11 example server.
    • Improved SSH example by having it use libsshtunnel instead of custom code.
    • Fixed HTTPD for multithreaded servers.
    • Fixed UTF-8 clipboard crash.
  2. LibVNCServer-0.9.142022-12-18 · 2022-12-18 21:01 UTC
    查看更新说明

    0.9.14 represents a gradual improvement over 0.9.13 with lots of developments all over the place. 40 issues and pull requests were closed/merged with this release. Highlights on the LibVNCServer side are a refined multi-threaded implementation, support for Unicode clipboard data 📋❗ and an outbound-connection machinery that works for real world use cases. LibVNCClient received support for SetDesktopSize (which had been added server-side in 0.9.13) and a properly documented SSH-tunneling setup.

    Overall changes:

    • Added more documentation (build system integration, repeater setup) and a legal FAQ.
    • Added contribution guidelines.
    • Ported the TravisCI continous integration machinery to GitHub workflows.

    LibVNCServer/LibVNCClient:

    LibVNCClient:

    • Fixes of several memory leaks and buffer overflows.
    • Added UltraVNC's MSLogonII authentication scheme.
    • Fixed TLS interoperability with GnuTLS servers.
    • Fixed detection of newer UltraVNC and TightVNC servers.
    • Added support for SetDesktopSize.
    • Added SSH tunneling example using libssh2.
    • Added some extensions to VeNCrypt in order to be compatible with a wider range of servers.

    LibVNCServer:

    • Fixes to the multi-threaded server implementation which should be a lot more sound now.
    • Fixed TightVNC-filetransfer file upload for 64-bit systems.
    • Fixes of crashes in the zlib compression.
    • Added support for UTF8 clipboard data.
    • Fixed visual artifacts in framebuffer on ARM platforms.
    • Fixed several WebSockets bugs.
    • Fixed the UltraVNC-style repeater example.
    • Added support for larger framebuffers (two 4k screens possible now).
    • Added support for timeouts for outbound connections (to repeaters for instance).
    • Fixed out-of-bounds memory access in Tight encoding.
  3. LibVNCServer-0.9.132020-06-13 · 2020-06-13 19:19 UTC
    查看更新说明

    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.
  4. LibVNCServer-0.9.122019-01-06 · 2019-01-06 19:26 UTC
    查看更新说明

    Over two years of work have now culminated in 0.9.12. We have ditched the legacy Autotools build system in favour of the truly cross-platform CMake and extended the continuous integration tests to run MS Windows builds as well. LibVNCServer saw quite some memory management issues fixed, LibVNCClient received X509 server certificate verification, Tight decoding optimizations, support for overriding the default rectangle decode handlers and a port of the SDL-based VNC viewer to SDL 2.0. 42 issues were fixed with this release.

    • 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.
  5. LibVNCServer-0.9.112016-12-30 · 2016-12-30 13:09 UTC
    查看更新说明

    After quite some time finally a major release featuring continous integration to make sure the code builds on all supported platforms. LibVNCClient saw a lot of robustness fixes making it more stable when dealing with broken or malicious servers. LibVNCServer received WebSocket improvements, its built-in webserver got more secure and systemd support was added.

    • 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.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    CI 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 have a general question, it's best to ask in the community chat. If your concern is about a bug or feature request instead, please use the issue tracker.

    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

    NameNumberLibVNCServerLibVNCClient
    None1✔✔
    VNC Authentication2✔✔
    SASL20✔
    MSLogon0xfffffffa✔
    Apple ARD30✔
    TLS18✔
    VeNCrypt19✔
    UltraVNC MSLogonII113✔

    Encodings

    NameNumberLibVNCServerLibVNCClient
    Raw1✔✔
    CopyRect2✔✔
    RRE3✔✔
    CoRRE4✔✔
    Hextile5✔✔
    Zlib6✔✔
    Tight7✔✔
    Ultra9✔✔
    TRLE15✔
    ZRLE16✔✔
    ZYWRLE17✔✔
    TightPNG-260✔

    Transports

    NameLibVNCServerLibVNCClient
    RFB✔✔
    Encrypted RFB via VeNCrypt✔
    Encrypted RFB via AnonTLS✔
    Websockets✔
    Encrypted Websockets✔

    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. Also note that you'll need to put libwinpthread-1.dll in the build dir to run the examples. You can find this DLL on your Linux build machine via locate libwinpthread-1.dll.

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

    Cutting a Release

    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/server directory.

    For LibVNCClient, examples can be found in examples/client.

    Incorporating LibVNCServer/LibVNCClient into your build system

    The install process installs pkg-config .pc files for LibVNCServer as well as LibVNCClient which you can use in your build system via the usual pkg-config --cflags libvncserver et al.

    If using CMake, LibVNCServer versions > 0.9.13 provide CMake configure files so in your project's CMakeLists.txt, you can say:

    find_package(LibVNCServer)
    if(LibVNCServer_FOUND)
    	# libs and headers location are now accessible via properties, but you only
    	# need to add the respective export target to your project's target_link_libraries,
    	# cmake will automatically add libs and headers
    	# eg: add client (YOUR_PROJECT_TARGET being a placeholder for your real target -
    	# it must be defined by add_executable or add_library):
    	target_link_libraries(YOUR_PROJECT_TARGET LibVNCServer::vncclient)
    	# add server:
    	target_link_libraries(YOUR_PROJECT_TARGET LibVNCServer::vncserver)
    endif()
    

    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.

    Achieving good performance on 'slow' links

    If your client-server connection is sluggish because the link is 'slow', there are a few things to consider.

    First off, you have to investigate whether your link has low throughput or high latency or both.

    Tackling High Latency

    On a high-latency link, try asking for framebuffer updates continously, as RFB is client-pull per default, not server-push. One example implementation can be found here and it definitely improves responsiveness.

    There also is the ContinuousUpdates RFB extension, but that one is not supported by LibVNC (yet).

    Tackling Low Throughput

    If your link is low-throughput, you basically have to reduce the number of bytes that get sent per framebuffer update:

    • First off, you should have your client request a lossy encoding such as Tight. This already yields some huge savings.
    • Use a pixel format that represents a pixel with a smaller amount of bytes. For instance, you can switch from 24-bit true colour to 16-bit high colour or even a palleted colour mode. You can request a pixel format via the client or set a default (native) one in the server. With the latter approach, however, you very probably also have to change the way your framebuffer data gets written, so the first client-side one should be preferred.
    • Send a scaled-down version of your framebuffer. You can do the scaling in your application feeding data into LibVNCServer's framebuffer (would affect all clients) or let LibVNCServer do the work for you if your client requests a scaled screen via a SetScale or SetScaleFactor message (this is per-client scaling - UltraVNC viewers can request this).

    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.

    Frequently Asked Questions

    Our commercial product wants to make use of LibVNCServer to create our own VNC server and distribute. Will this be considered derivative work in the GPLv2 context?

    Yes. Please note that while you would have to stick to the GPL for your program if you link to LibVNCServer/LibVNCClient, you do not have to make your code public in case you use the derivative work internally in your organisation, see https://www.gnu.org/licenses/gpl-faq.html#GPLRequireSourcePostedPublic

    Does modifying LibVNCServer code or not make any difference in determining whether our VNC server will be considered derivative work?

    No. By simply linking to LibVNCServer/LibVNCClient, your program becomes derivative work.

    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