Application Servers

Wt – web GUI library

Wt is a C++ library for developing web applications.

Wt handles all the nitty-gritty of requests and responses and client-side JavaScript, and allows you to focus on functionality in pure C++.

Wt’s widget abstraction represents HTML elements as C++ objects, allowing them to be easily composable and extendable.

This is free and open source software.

Key Features

  • Stable API.
  • Secure – designed to be resilient against the most common types of exploits: SQL injection, XSS and CSRF vulnerabilities.
  • Core library:
    • Hybrid single page framework with full support for browser history navigation and SEO.
    • Compatible with HTML5 and HTML4 browsers, but also plain HTML user agents (including web crawlers).
    • Develop in and deploy on Linux, UNIX (macOS, FreeBSD, …), or Microsoft Windows (Visual Studio and MinGW) environments.
    • High performance (you’d expect nothing else from a C++ library), using asynchronous I/O throughout, multi-threaded, optimized rendering, …
    • Allows integration of 3rd party JavaScript libraries/
  • Event handling:
    • Typesafe C++11 signal/slot API for responding to events: attach C++ code (such as C++11 lambdas or bound object methods) to react to events from keyboard, mouse, touch, history navigation, etc.
    • Automated and efficient synchronization of browser and server state, using incremental rendering updates.
    • Server-initiated updates using WebSockets with automatic fallback to Ajax long polling.
  • 2D and 3D painting:
    • 2D painting API which leverages the browsers native (vector) graphics support (HTML5 canvas, inline SVG or inline VML), but can also render to common image formats (PNG, GIF, …) or vector formats (SVG, PDF).
    • Unified hardware-accelerated 3D painting API which leverages WebGL in the browser or server-side OpenGL (fallback).
    • Integrated capable HTML/CSS renderer lets you generate high quality dynamic PDF reports easily.
  • Built-in security:
    • In dedicated process mode: ability to leverage kernel-level memory protection to isolate sessions.
    • TLS/SSL support.
    • Built-in Cross-Site Scripting (XSS) prevention. Rendered text is always filtered against potentially malicious code, making XSS attacks against Wt applications (close to) impossible.
    • Built-in Cross-Site Request Forgery (CSRF) prevention. Using cookies for session tracking is not necessary nor recommended. Cookies are never solely relied on for requests that trigger event handling code.
    • Application logic attack prevention. Only those events exposed in the interface (accessible from a button, for example) can be triggered.
    • Session hijacking mitigation and risk prevention.
    • DoS mitigation.
    • Authentication module which implements best practices for authentication, including support for OAuth 2.0 and OpenID Connect.
  • Self-contained library which implements an Object-Relational Mapper (ORM) for C++, and thus a convenient way to interact with SQL databases from C++:
    • No code generation, no macro hacks, no XML configuration, just C++.
    • Uses a templated visitor pattern which requires a single template method to provide the mapping: DRY and efficient.
    • Flexible mapping support which includes support for surrogate auto-incremental keys or natural keys of any C++ type, which may also be composite (i.e. require more than one database field).
    • Supports optimistic concurrency control using a version field.
    • Maps Many-to-One and Many-to-Many relations to STL-compatible collections.
    • Provides schema generation (aka DDL: data definition language) and CRUD operations (aka DML: data manipulation language).
    • Transactions, prepared statements and connection pooling.
    • Each session tracks dirty objects and provides a first-level cache.
    • Uses native SQL to query individual fields and/or objects.
    • Comes with Sqlite3, Firebird, MariaDB/MySQL, SQL Server and PostgreSQL backends, and an Oracle backend is also available on request.
  • Deployment:
    • Built-in HTTPD:
      • Simple, high performance web application server (multi-threaded, asynchronous I/O) based on the C++ asio library.
      • Supports the HTTP(S) and (Secure) WebSocket protocols.
      • Supports response chunking and compression.
      • Can be deployed as a single process (convenient for development and debugging) or multiple processes (e.g. a separate process per session), and is embeddable in an existing application.
      • Host multiple applications on the same server, by bolting a reverse proxy in front.
      • Available for Linux, UNIX, and Windows platforms.
    • FastCGI:
      • Legacy protocol that integrates with most common web servers (apache, lighttpd).
      • Different session-to-process mapping strategies.
      • Hot deployment: new sessions use the new application version while older sessions may continue with their application version.
      • Available only for Linux and UNIX.
    • ISAPI:
      • Integrates with Microsoft IIS server.
      • Uses the ISAPI asynchronous API for maximum performance.
      • Available for Windows.

Website: www.webtoolkit.eu/wt
Support: Documentation, GitHub Code Repository
Developer: Emweb
License: GNU General Public License, Version 2, with OpenSSL exception. Commercial license is also available.

Wt is written in C++. Learn C++ with our recommended free books and free tutorials.


Related Software

C++ Web Frameworks
DrogonA fast cross-platform web framework
Oat++Light and powerful web framework with zero dependencies
CrowFast and easy to use micro web framework (inspired by Python Flask)
TreeFrogHigh-speed and full-stack C++ framework
POCOC++ libraries for building applications
WtWeb GUI library in modern C++
PistacheHigh-performance REST toolkit
CutelystWeb framework built on top of Qt, using the approach of Catalyst (Perl) framework
CppCMSAimed at rapid web development of web sites and web services
ffead-cppWeb framework, application framework

Read our verdict in the software roundup.

C++ Application Servers
POCOC++ libraries for building applications
WtC++ library for developing web applications
CppCMSWeb development framework for performance demanding applications
Enduro/XMiddleware platform for distributed transaction processing
TntnetWeb application server for web applications written in C++

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Know a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments