{"id":104506,"date":"2022-06-25T15:36:47","date_gmt":"2022-06-25T13:36:47","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv"},"modified":"2022-06-25T15:36:47","modified_gmt":"2022-06-25T13:36:47","slug":"redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","title":{"rendered":"Redbean 2.0 \u2014 a platform for web applications packaged in a universal executable ZIP archive","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>The release of the Redbean 2.0 project has been introduced, offering a web server that allows the delivery of web applications in the form of a universal executable file, which can be run on Linux, Windows, macOS, FreeBSD, NetBSD, and OpenBSD. All resources related to the web application and server are compiled into a single executable file, which is compatible with ZIP archive format and allows the use of the zip utility to add additional files. The ability to run a single file on different operating systems and recognize it as a ZIP archive is achieved through manipulations with the headers of executable files and linking with the cross-platform standard C library Cosmopolitan. The project's code is distributed under the ISC license.      <\/p>\n<p>The project idea is to provide a single executable file 'redbean.com' with an embedded web server. A web application developer can use the zip utility to add HTML and Lua files to this file and obtain a standalone web application that runs on all popular operating systems without requiring a separate web server to be launched in the system.         <\/p>\n<p>Once the generated executable file is launched, the built-in web server is used to access the web application saved in the file. By default, the handler is attached to localhost, but the server can also be used as a regular public web server (for example, this server hosts the project's website). The built-in web server supports HTTPS access and can operate using sandbox isolation, allowing control over which system interfaces are accessed. An interactive REPL interface (based on Lua REPL and the bestline library, a counterpart to GNU Readline) is provided to manage server operations during execution, enabling real-time process state changes.      <\/p>\n<p>It is claimed that the web server can handle more than a million requests per second on a standard PC, delivering content compressed with the gzip method. Its high performance is facilitated by the fact that zip and gzip use a common format, allowing data to be served without repacking from already compressed areas in the zip file. Additionally, since the executable file is created using static linking and has a small size, calling the fork function incurs almost no overhead when placed in memory.       <\/p>\n<p>In addition to processing static web content and executing JavaScript in the browser, the logic of a web application can be extended through scripts in Lua, the Fullmoon web framework, and the SQLite database. Notable additional features include support for the argon2 password hashing scheme, the ability to determine the IP region using the MaxMind database, and access to the Unix API via the Cosmopolitan library. The size of the base stack, which includes the web server, MbedTLS, Cosmopolitan, Lua, and SQLite, is only 1.9 MB.     <\/p>\n<p>The universal executable file is formed by combining segments and headers specific to different operating systems (PE, ELF, MACHO, OPENBSD, ZIP) into one file. To ensure that a single executable file runs in both Windows and Unix systems, a trick is used that involves encoding Windows PE files in the form of a shell script, taking advantage of the fact that the Thompson Shell does not use the script marker '#!'. As a result, an executable file is created that combines several different formats used in Linux, BSD, Windows, and macOS.         $ curl https:\/\/redbean.dev\/redbean-demo-2.0.7.com &gt; redbean.com     $ chmod +x redbean.com       $ zip redbean.com hello.html     $ zip redbean.com hello.lua        $ .\/redbean.com -vv     I2022-06-23T08:27:14+000767:redbean] (srvr) listen   http:\/\/127.0.0.1:8080     &gt;: waiting for command\u2026       $ curl https:\/\/127.0.0.1:8080\/hello.html     hello          $ printf 'GET \/hello.lua\\n\\n' | nc 127.0.0.1 8080     hello        <center>  <video id=\"video\"  controls=\"\" style=\"width: 700px; height: 350px; max-width:100%\"><source src=\"https:\/\/storage.googleapis.com\/justine\/redbean2\/redbean-2.0-demo.mp4\" type=\"video\/mp4\"><\/video><\/center>    <\/center><br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=57407\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD \u0438 OpenBSD. \u0412\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0430\u0440\u0445\u0438\u0432\u043e\u0432 ZIP \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 zip \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-104506","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Redbean 2.0 \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 ZIP-\u0430\u0440\u0445\u0438\u0432 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-06-25T13:36:47+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-06-25T13:36:47+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47 Redbean 2.0 \u2014 a platform for web applications packaged in a universal executable ZIP archive | ProHoster","description":"The Redbean project 2.0 has been released, offering a web server that allows web applications to be delivered in the form of a universal executable file that can be run on Linux, Windows, MacOS, FreeBSD, and NetBSD.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Redbean 2.0 \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 ZIP-\u0430\u0440\u0445\u0438\u0432 | ProHoster","og:description":"\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2022-06-25T13:36:47+00:00","article:modified_time":"2022-06-25T13:36:47+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"104506","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2022-06-25 13:36:54","updated":"2022-09-28 11:49:08","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/104506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=104506"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/104506\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=104506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=104506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=104506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}