presented the project redbean 2.0 , offering A Web server that allows you to supply Web applications in the form of a universal executable file, which can be made in Linux, Windows, MacOS, FreeBSD, NetBSD and OpenBSD. All resources related to the Web-application and the server will be compiled in one executable file, which is compatible with the ZIP archives format and allows the use of the ZIP utility to add additional files. The ability to launch one file in different OS and its recognition as a ZIP archive is achieved due to manipulations with the headings of executable files and binding to the multifaceted standard SI-biblust cosmopolitan . Project code spreads under the license of ISC.
The idea of the project in the supply of one executable File “Redbean.com” with a built-in Web server. The web application developer can use the ZIP utility to this HTML and Lua files and get a self-sufficient Web application performed in all popular OS and does not require launching in the system of a separate web server.
After starting the resulting file, a built-in Web server is used to contact the Web application saved in the Web application file. By default, the processor is attached to the localhost, but the server can also be applied as a regular public web server (for example, this server serves site of the project). The built-in Web server supports HTTPS circulation and can be performed using Sandbox insulation, which allows you to control which system interfaces are being transmitted. To manage the server’s operation during its execution, an interactive Repl interface (based on Lua Repl and the library bestline , analogue GNU Readline), which makes it possible for GNU Readline). change the condition of the process in interactive mode.
It is claimed that the Web server is able to process more than a million requests per second on a regular PC, giving content compressed by the GZIP method. High performance contributes to the fact that ZIP and GZIP use the general format, so the data is given without re-launch from already compressed areas in the ZIP file. In addition, since the executable file is created using static binding and has a small size, the FORK function call for it practically does not lead to overhead costs when placing in memory.
In addition to processing static Web content and performing JavaScript in a browser, the logic of the application can expand using scripts in Lua, Web-framework Fullmoon and SQLite DBMS. Among the additional capabilities, support for the ARGON2 password hash design, the possibility of determining the IP region on the MaxMind base and access to more 1400 to the functions API provided library Cosmopolitan. The size of the basic stack, including the Web server, MBEDTLS, COSMOPOPOLITAN, LUA and SQLite, is only 1.9 Mb.