{"id":339951,"date":"2022-10-19T09:00:51","date_gmt":"2022-10-19T09:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339951"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339951","title":{"rendered":"<span>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/789\/5f1\/318\/7895f1318371d2cab1aeb1eda2899e34.jpg\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/789\/5f1\/318\/7895f1318371d2cab1aeb1eda2899e34.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u044d\u0442\u043e \u043c\u043e\u044f \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0432\u044b\u0439\u0434\u0443 \u0437\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c ML \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u044e \u0432\u0430\u0441 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0432\u043e\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>\u043a\u043b\u0438\u0435\u043d\u0442\/\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432<\/strong> \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0442\u0438\u043f\u0430 <strong>HTTP<\/strong>, \u0442\u0430\u043a \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0442\u0430\u043a \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e\u0431 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0438 \u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"https:\/\/curl.se\/\" rel=\"noopener noreferrer nofollow\"><strong>CURL<\/strong><\/a> \u0438\u043b\u0438 <a href=\"https:\/\/nginx.org\/ru\/\" rel=\"noopener noreferrer nofollow\"><strong>NGINX<\/strong><\/a>. \u041a\u043e\u0433\u0434\u0430 \u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0412 \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0438\u0434\u0435\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u043b \u0431\u044b \u043a\u0430\u0440\u043a\u0430\u0441\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0441\u0435\u0442\u044c\u044e \u0431\u0440\u0430\u043b \u043d\u0430 \u0441\u0435\u0431\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043c\u043d\u043e\u044e \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\"><strong>AWH<\/strong><\/a>.<\/p>\n<p><strong>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 <\/strong><a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\"><strong>AWH<\/strong><\/a><strong> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>DNS \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>HTTP(S) \u043a\u043b\u0438\u0435\u043d\u0442<\/p>\n<\/li>\n<li>\n<p>WEB \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>Socks5 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>HTTPS \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>WebSocket \u043a\u043b\u0438\u0435\u043d\u0442<\/p>\n<\/li>\n<li>\n<p>WebSocket \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u0436\u0430\u0442\u0438\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Gzip\" rel=\"noopener noreferrer nofollow\">GZIP<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Deflate\" rel=\"noopener noreferrer nofollow\">DEFLATE<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Brotli\" rel=\"noopener noreferrer nofollow\">BROTLI<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Basic_access_authentication\" rel=\"noopener noreferrer nofollow\">Basic<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B0%D0%B9%D0%B4%D0%B6%D0%B5%D1%81%D1%82-%D0%B0%D1%83%D1%82%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">Digest<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c:<\/strong><\/p>\n<ul>\n<li>\n<p>Windows (TCP, TLS, UDP, DTLS)<\/p>\n<\/li>\n<li>\n<p>Linux (TCP, TLS, UDP, DTLS, SCTP, UnixSocket)<\/p>\n<\/li>\n<li>\n<p>FreeBSD (TCP, TLS, UDP, DTLS, SCTP, UnixSocket)<\/p>\n<\/li>\n<li>\n<p>MacOS X (TCP, TLS, UDP, DTLS, UnixSocket)<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0441\u0431\u043e\u0440\u043a\u0430:<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 <a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\">AWH<\/a> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0421\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"http:\/\/software.schmorp.de\/pkg\/libev.html\" rel=\"noopener noreferrer nofollow\">LibEv<\/a> \u0434\u043b\u044f *.Nix \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u043d\u0430 <a href=\"http:\/\/www.wangafu.net\/~nickm\/libevent-2.0\/doxygen\/html\/\" rel=\"noopener noreferrer nofollow\">LibEvent2<\/a> \u0434\u043b\u044f Windows.<\/p>\n<details class=\"spoiler\">\n<summary>FreeBSD<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\"># \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 SCTP $ sudo kldload sctp  # \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 IDN2 $ .\/build_third_party.sh --idn  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_TYPE=Release \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ make  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b DTLS $ cd .\/ca $ .\/cert.sh<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Linux (Ubuntu)<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\"># \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 SCTP $ sudo apt install libsctp-dev $ modprobe sctp $ sysctl -w net.sctp.auth_enable=1  # \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 IDN2 $ .\/build_third_party.sh --idn  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_TYPE=Release \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ make  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b DTLS $ cd .\/ca $ .\/cert.sh<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>MacOS X<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\"># \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 IDN2 $ .\/build_third_party.sh --idn  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_TYPE=Release \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ make  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b DTLS $ cd .\/ca $ .\/cert.sh<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Windows<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 <a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\">AWH<\/a> \u043f\u043e\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Windows \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/p>\n<p><strong>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/git-scm.com\" rel=\"noopener noreferrer nofollow\">GIT<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/strawberryperl.com\" rel=\"noopener noreferrer nofollow\">Perl<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.python.org\/downloads\/windows\" rel=\"noopener noreferrer nofollow\">Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.msys2.org\" rel=\"noopener noreferrer nofollow\">MSYS2<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cmake.org\/download\" rel=\"noopener noreferrer nofollow\">CMAKE<\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 MSYS2 MinGW64<\/p>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 $ pacman -Syuu $ pacman -S mingw64\/mingw-w64-x86_64-cmake $ pacman -S make $ pacman -S curl $ pacman -S wget $ pacman -S mc $ pacman -S gdb $ pacman -S bash $ pacman -S clang $ pacman -S git $ pacman -S --needed base-devel mingw-w64-x86_64-toolchain $ pacman -S mingw-w64-x86_64-dlfcn<\/code><\/pre>\n<pre><code class=\"bash\"># \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 LibEvent2 $ .\/build_third_party.sh --event2  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -G \"MinGW Makefiles\" \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_EVENT2=yes \\  -DCMAKE_BUILD_TYPE=Release \\  -DCMAKE_SYSTEM_NAME=Windows \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cmake --build .<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>HTTP(S) \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/rest.hpp>  using namespace std; using namespace awh;  class WebClient { private: log_t * _log; public: void active(const client::rest_t::mode_t mode, client::rest_t * web){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::rest_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } public: WebClient(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk); network_t nwk(&amp;fmk); uri_t uri(&amp;fmk, &amp;nwk);  WebClient executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::rest_t rest(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"REST Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.ca(\".\/ca\/cert.pem\"); \/\/ core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::TCP); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  rest.mode( (uint8_t) client::rest_t::flag_t::NOINFO | (uint8_t) client::rest_t::flag_t::WAITMESS | (uint8_t) client::rest_t::flag_t::REDIRECTS | (uint8_t) client::rest_t::flag_t::VERIFYSSL ); \/\/ rest.proxy(\"http:\/\/user:password@host.com:port\"); rest.proxy(\"socks5:\/\/user:password@host.com:port\"); rest.compress(http_t::compress_t::ALL_COMPRESS); rest.on(bind(&amp;WebClient::active, &amp;executor, _1, _2));  const auto &amp; body = rest.GET(uri.parse(\"https:\/\/2ip.ru\"), {{\"User-Agent\", \"curl\/7.64.1\"}});  log.print(\"ip: %s\", log_t::flag_t::INFO, body.data());  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Web \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/rest.hpp>  using namespace std; using namespace awh;  class WebServer { private: log_t * _log; public: string password(const string &amp; login){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), \"password\"); return \"password\"; } bool auth(const string &amp; login, const string &amp; password){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), password.c_str()); return true; } public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::rest_t * web){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::rest_t::mode_t mode, server::rest_t * web){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::rest_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const awh::http_t * http, server::rest_t * web){ const auto &amp; query = http->query();  if(!query.uri.empty() &amp;&amp; (query.uri.find(\"favicon.ico\") != string::npos)) web->reject(aid, 404); else if(query.method == web_t::method_t::GET){ const string body = \"&lt;html>\\n&lt;head>\\n&lt;title>Hello World!&lt;\/title>\\n&lt;\/head>\\n&lt;body>\\n\" \"&lt;h1>\\\"Hello, World!\\\" program&lt;\/h1>\\n\" \"&lt;div>\\nFrom Wikipedia, the free encyclopedia&lt;br>\\n\" \"(Redirected from Hello, world!)&lt;br>\\n\" \"Jump to navigationJump to search&lt;br>\\n\" \"&lt;strong>\\\"Hello World\\\"&lt;\/strong> redirects here. For other uses, see Hello World (disambiguation).&lt;br>\\n\" \"A &lt;strong>\\\"Hello, World!\\\"&lt;\/strong> program generally is a computer program that outputs or displays the message \\\"Hello, World!\\\".&lt;br>\\n\" \"Such a program is very simple in most programming languages, and is often used to illustrate the basic syntax of a programming language. It is often the first program written by people learning to code. It can also be used as a sanity test to make sure that computer software intended to compile or run source code is correctly installed, and that the operator understands how to use it.\\n\" \"&lt;\/div>\\n&lt;\/body>\\n&lt;\/html>\\n\"; web->response(aid, 200, \"OK\", vector &lt;char> (body.begin(), body.end())); } } public: WebServer(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  WebServer executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::rest_t rest(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"Web Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.clusterSize(4); core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::TLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/server-cert.pem\", \".\/ca\/certs\/server-key.pem\");  rest.realm(\"ANYKS\"); rest.opaque(\"keySession\"); rest.authType(auth_t::type_t::DIGEST, auth_t::hash_t::MD5); rest.init(2222, \"127.0.0.1\", http_t::compress_t::ALL_COMPRESS);  rest.on((function &lt;string (const string &amp;)>) bind(&amp;WebServer::password, &amp;executor, _1)); \/\/ rest.on((function &lt;bool (const string &amp;, const string &amp;)>) bind(&amp;WebServer::auth, &amp;executor, _1, _2)); rest.on((function &lt;void (const size_t, const awh::http_t *, server::rest_t *)>) bind(&amp;WebServer::message, &amp;executor, _1, _2, _3)); rest.on((function &lt;void (const size_t, const server::rest_t::mode_t, server::rest_t *)>) bind(&amp;WebServer::active, &amp;executor, _1, _2, _3)); rest.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::rest_t *)>) bind(&amp;WebServer::accept, &amp;executor, _1, _2, _3, _4));  rest.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>WebSocket \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/ws.hpp>  using namespace std; using namespace awh;  class WebSocket { private: log_t * _log; public: void active(const client::ws_t::mode_t mode, client::ws_t * ws){ this->_log->print(\"%s server\", log_t::flag_t::INFO, (mode == client::ws_t::mode_t::CONNECT ? \"Start\" : \"Stop\"));  if(mode == client::ws_t::mode_t::CONNECT){ const string query = \"{\\\"text\\\":\\\"Hello World!\\\"}\"; ws->send(query.data(), query.size()); } } void error(const u_int code, const string &amp; mess, client::ws_t * ws){ this->_log->print(\"%s [%u]\", log_t::flag_t::CRITICAL, mess.c_str(), code); } void message(const vector &lt;char> &amp; buffer, const bool utf8, client::ws_t * ws){ if(utf8 &amp;&amp; !buffer.empty()) this->_log->print(\"message: %s [%s]\", log_t::flag_t::INFO, string(buffer.begin(), buffer.end()).c_str(), ws->sub().c_str()); } public: WebSocket(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  WebSocket executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::ws_t ws(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"WebSocket Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  ws.mode( (uint8_t) client::ws_t::flag_t::TAKEOVERCLI | (uint8_t) client::ws_t::flag_t::TAKEOVERSRV | (uint8_t) client::ws_t::flag_t::VERIFYSSL | (uint8_t) client::ws_t::flag_t::KEEPALIVE );  core.verifySSL(false); core.ca(\".\/ca\/cert.pem\"); core.sonet(awh::scheme_t::sonet_t::TLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/client-cert.pem\", \".\/ca\/certs\/client-key.pem\");  \/\/ ws.proxy(\"http:\/\/user:password@host.com:port\"); \/\/ ws.proxy(\"socks5:\/\/user:password@host.com:port\"); \/\/ ws.authTypeProxy(auth_t::type_t::BASIC); \/\/ ws.authTypeProxy(auth_t::type_t::DIGEST, auth_t::hash_t::MD5);  ws.user(\"user\", \"password\"); \/\/ ws.authType(auth_t::type_t::BASIC); ws.authType(auth_t::type_t::DIGEST, auth_t::hash_t::MD5);  ws.subs({\"test2\", \"test8\", \"test9\"}); ws.init(\"wss:\/\/127.0.0.1:2222\", http_t::compress_t::DEFLATE);  ws.on(bind(&amp;WebSocket::active, &amp;executor, _1, _2)); ws.on(bind(&amp;WebSocket::error, &amp;executor, _1, _2, _3)); ws.on(bind(&amp;WebSocket::message, &amp;executor, _1, _2, _3));  ws.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>WebSocket \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/ws.hpp>  using namespace std; using namespace awh;  class WebSocket { private: log_t * _log; public: string password(const string &amp; login){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), \"password\"); return \"password\"; } bool auth(const string &amp; login, const string &amp; password){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), password.c_str()); return true; } public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::ws_t * ws){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::ws_t::mode_t mode, server::ws_t * ws){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::ws_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void error(const size_t aid, const u_int code, const string &amp; mess, server::ws_t * ws){ this->_log->print(\"%s [%u]\", log_t::flag_t::CRITICAL, mess.c_str(), code); } void message(const size_t aid, const vector &lt;char> &amp; buffer, const bool utf8, server::ws_t * ws){ if(!buffer.empty()){ this->_log->print(\"message: %s [%s]\", log_t::flag_t::INFO, string(buffer.begin(), buffer.end()).c_str(), ws->sub(aid).c_str()); ws->send(aid, buffer.data(), buffer.size(), utf8); } } public: WebSocket(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  WebSocket executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::ws_t ws(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"WebSocket Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.clusterSize(); core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::TLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/server-cert.pem\", \".\/ca\/certs\/server-key.pem\");  ws.realm(\"ANYKS\"); ws.opaque(\"keySession\"); ws.subs({\"test1\", \"test2\", \"test3\"});  \/\/ ws.authType(auth_t::type_t::BASIC); ws.authType(auth_t::type_t::DIGEST, auth_t::hash_t::MD5); ws.init(2222, \"127.0.0.1\", http_t::compress_t::DEFLATE);  ws.on((function &lt;string (const string &amp;)>) bind(&amp;WebSocket::password, &amp;executor, _1)); \/\/ ws.on((function &lt;bool (const string &amp;, const string &amp;)>) bind(&amp;WebSocket::auth, &amp;executor, _1, _2)); ws.on((function &lt;void (const size_t, const server::ws_t::mode_t, server::ws_t *)>) bind(&amp;WebSocket::active, &amp;executor, _1, _2, _3)); ws.on((function &lt;void (const size_t, const u_int, const string &amp;, server::ws_t *)>) bind(&amp;WebSocket::error, &amp;executor, _1, _2, _3, _4)); ws.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::ws_t *)>) bind(&amp;WebSocket::accept, &amp;executor, _1, _2, _3, _4)); ws.on((function &lt;void (const size_t, const vector &lt;char> &amp;, const bool, server::ws_t *)>) bind(&amp;WebSocket::message, &amp;executor, _1, _2, _3, _4));  ws.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>HTTPS \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/proxy.hpp>  using namespace std; using namespace awh;  class Proxy { private: log_t * _log; public: string password(const string &amp; login){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), \"password\"); return \"password\"; } bool auth(const string &amp; login, const string &amp; password){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), password.c_str()); return true; } public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::proxy_t * proxy){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::proxy_t::mode_t mode, server::proxy_t * proxy){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::proxy_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } bool message(const size_t aid, const server::proxy_t::event_t event, awh::http_t * http, server::proxy_t * proxy){ cout &lt;&lt; (event == server::proxy_t::event_t::REQUEST ? \"REQUEST\" : \"RESPONSE\") &lt;&lt; endl; for(auto &amp; header : http->headers()) cout &lt;&lt; \"Header: \" &lt;&lt; header.first &lt;&lt; \" = \" &lt;&lt; header.second &lt;&lt; endl &lt;&lt; endl; return true; } public: Proxy(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Proxy executor(&amp;log);  server::proxy_t proxy(&amp;fmk, &amp;log);  log.setLogName(\"Proxy Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  proxy.mode( (uint8_t) server::proxy_t::flag_t::NOINFO | (uint8_t) server::proxy_t::flag_t::WAITMESS ); proxy.clusterSize();  \/\/ proxy.realm(\"ANYKS\"); \/\/ proxy.opaque(\"keySession\");  proxy.authType(auth_t::type_t::BASIC); \/\/ proxy.authType(auth_t::type_t::DIGEST, auth_t::hash_t::MD5); proxy.sonet(awh::scheme_t::sonet_t::TCP); proxy.init(2222, \"127.0.0.1\", http_t::compress_t::GZIP);  \/\/ proxy.on((function &lt;string (const string &amp;)>) bind(&amp;Proxy::password, &amp;executor, _1)); proxy.on((function &lt;bool (const string &amp;, const string &amp;)>) bind(&amp;Proxy::auth, &amp;executor, _1, _2)); proxy.on((function &lt;void (const size_t, const server::proxy_t::mode_t, server::proxy_t *)>) bind(&amp;Proxy::active, &amp;executor, _1, _2, _3)); proxy.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::proxy_t *)>) bind(&amp;Proxy::accept, &amp;executor, _1, _2, _3, _4)); proxy.on((function &lt;bool (const size_t, const server::proxy_t::event_t, awh::http_t *, server::proxy_t *)>) bind(&amp;Proxy::message, &amp;executor, _1, _2, _3, _4));  proxy.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Socks5 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/socks5.hpp>  using namespace std; using namespace awh; using namespace server;  class Proxy { private: log_t * _log; public: bool auth(const string &amp; login, const string &amp; password){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), password.c_str()); return true; } public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, proxy_socks5_t * proxy){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const proxy_socks5_t::mode_t mode, proxy_socks5_t * proxy){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == proxy_socks5_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } public: Proxy(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Proxy executor(&amp;log);  proxy_socks5_t proxy(&amp;fmk, &amp;log);  log.setLogName(\"Proxy Socks5 Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  proxy.mode( (uint8_t) proxy_socks5_t::flag_t::NOINFO | (uint8_t) proxy_socks5_t::flag_t::WAITMESS ); proxy.clusterSize();  proxy.init(2222, \"127.0.0.1\");  proxy.on((function &lt;bool (const string &amp;, const string &amp;)>) bind(&amp;Proxy::auth, &amp;executor, _1, _2)); proxy.on((function &lt;void (const size_t, const proxy_socks5_t::mode_t, proxy_socks5_t *)>) bind(&amp;Proxy::active, &amp;executor, _1, _2, _3)); proxy.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, proxy_socks5_t *)>) bind(&amp;Proxy::accept, &amp;executor, _1, _2, _3, _4));  proxy.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0422\u0430\u0439\u043c\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;chrono> #include &lt;core\/core.hpp>  using namespace std; using namespace awh;  class Timer { private: chrono::time_point &lt;chrono::system_clock> ts; chrono::time_point &lt;chrono::system_clock> is; private: u_short count; private: log_t * _log; public: void interval(const u_short id, core_t * core){ auto shift = chrono::system_clock::now();  this->_log->print(\"Interval: %u seconds\", log_t::flag_t::INFO, chrono::duration_cast &lt;chrono::seconds> (shift - this->is).count());  this->is = shift;  if((this->count++) >= 10){ core->clearTimer(id); core->stop(); } } void timeout(const u_short id, core_t * core){ this->_log->print(\"Timeout: %u seconds\", log_t::flag_t::INFO, chrono::duration_cast &lt;chrono::seconds> (chrono::system_clock::now() - this->ts).count()); } void run(const bool mode, Core * core){ if(mode){ this->ts = chrono::system_clock::now(); this->is = chrono::system_clock::now();  this->_log->print(\"%s\", log_t::flag_t::INFO, \"Start timer\");  core->setTimeout(10000, (function &lt;void (const u_short, core_t *)>) bind(&amp;Timer::timeout, this, _1, _2)); core->setInterval(5000, (function &lt;void (const u_short, core_t *)>) bind(&amp;Timer::interval, this, _1, _2)); } else this->_log->print(\"%s\", log_t::flag_t::INFO, \"Stop timer\"); } public: Timer(log_t * log) : ts(chrono::system_clock::now()), is(chrono::system_clock::now()), count(0), _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Timer executor(&amp;log);  core_t core(awh::core_t::affiliation_t::PRIMARY, &amp;fmk, &amp;log);  log.setLogName(\"Timer\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.callback((function &lt;void (const bool, core_t *)>) bind(&amp;Timer::run, &amp;executor, _1, _2));  core.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>DNS \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;core\/core.hpp>  using namespace std; using namespace awh;  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk); core_t core(awh::core_t::affiliation_t::PRIMARY, &amp;fmk, &amp;log);  log.setLogName(\"DNS\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.resolve(\"google.com\", scheme_t::family_t::IPV4, [&amp;log](const string &amp; ip, const scheme_t::family_t family, core_t * core){ log.print(\"IP: %s\", log_t::flag_t::INFO, ip.c_str()); core->stop(); });  core.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>TCP \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.sonet(awh::scheme_t::sonet_t::TCP); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(2222, \"127.0.0.1\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>TCP \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.sonet(awh::scheme_t::sonet_t::TCP); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(2222, \"127.0.0.1\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>TLS \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.verifySSL(false); core.ca(\".\/ca\/cert.pem\"); core.sonet(awh::scheme_t::sonet_t::TLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/client-cert.pem\", \".\/ca\/certs\/client-key.pem\");  sample.init(2222, \"127.0.0.1\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>TLS \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::TLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/server-cert.pem\", \".\/ca\/certs\/server-key.pem\");  sample.init(2222, \"127.0.0.1\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>UDP \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.sonet(awh::scheme_t::sonet_t::UDP); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(2222, \"127.0.0.1\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>UDP \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.sonet(awh::scheme_t::sonet_t::UDP); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(2222, \"127.0.0.1\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>SCTP \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.verifySSL(false); core.ca(\".\/ca\/cert.pem\"); core.sonet(awh::scheme_t::sonet_t::SCTP); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/client-cert.pem\", \".\/ca\/certs\/client-key.pem\");  sample.init(2222, \"127.0.0.1\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>SCTP \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::SCTP); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/server-cert.pem\", \".\/ca\/certs\/server-key.pem\");  sample.init(2222, \"127.0.0.1\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>DTLS \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.verifySSL(false); core.ca(\".\/ca\/cert.pem\"); core.sonet(awh::scheme_t::sonet_t::DTLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/client-cert.pem\", \".\/ca\/certs\/client-key.pem\");  sample.init(2222, \"127.0.0.1\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>DTLS \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::DTLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/server-cert.pem\", \".\/ca\/certs\/server-key.pem\");  sample.init(2222, \"127.0.0.1\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>TCP UnixSocket \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.sonet(awh::scheme_t::sonet_t::TCP); core.family(awh::scheme_t::family_t::NIX); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(\"anyks\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>TCP UnixSocket \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.sonet(awh::scheme_t::sonet_t::TCP); core.family(awh::scheme_t::family_t::NIX); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(\"anyks\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>UDP UnixSocket \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/sample.hpp>  using namespace std; using namespace awh;  class Client { private: log_t * _log; public: void active(const client::sample_t::mode_t mode, client::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); if(mode == client::sample_t::mode_t::CONNECT){ const string message = \"Hello World!!!\"; sample->send(message.data(), message.size()); } } void message(const vector &lt;char> &amp; buffer, client::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->stop(); } public: Client(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Client executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  sample.mode( \/\/ (uint8_t) client::sample_t::flag_t::NOINFO | (uint8_t) client::sample_t::flag_t::WAITMESS | (uint8_t) client::sample_t::flag_t::VERIFYSSL ); core.sonet(awh::scheme_t::sonet_t::UDP); core.family(awh::scheme_t::family_t::NIX); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(\"anyks\"); sample.on(bind(&amp;Client::active, &amp;executor, _1, _2)); sample.on(bind(&amp;Client::message, &amp;executor, _1, _2));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>UDP UnixSocket \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/sample.hpp>  using namespace std; using namespace awh;  class Server { private: log_t * _log; public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::sample_t * sample){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::sample_t::mode_t mode, server::sample_t * sample){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::sample_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const vector &lt;char> &amp; buffer, server::sample_t * sample){ const string message(buffer.begin(), buffer.end()); this->_log->print(\"%s\", log_t::flag_t::INFO, message.c_str()); sample->send(aid, buffer.data(), buffer.size()); } public: Server(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  Server executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::sample_t sample(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"SAMPLE Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.sonet(awh::scheme_t::sonet_t::UDP); core.family(awh::scheme_t::family_t::NIX); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  sample.init(\"anyks\"); sample.on((function &lt;void (const size_t, const vector &lt;char> &amp;, server::sample_t *)>) bind(&amp;Server::message, &amp;executor, _1, _2, _3)); sample.on((function &lt;void (const size_t, const server::sample_t::mode_t, server::sample_t *)>) bind(&amp;Server::active, &amp;executor, _1, _2, _3)); sample.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::sample_t *)>) bind(&amp;Server::accept, &amp;executor, _1, _2, _3, _4));  sample.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u0430\u0440\u043a\u0430\u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041a\u043b\u0438\u0435\u043d\u0442\u044b \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 unix-\u0441\u043e\u043a\u0435\u0442 \u0438\u043b\u0438 WebSocket-\u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u0430\u043a DTLS.<\/p>\n<p>\u042f \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0442\u0430\u043a\u0438\u043c\u0438, \u043a\u0430\u043a <a href=\"https:\/\/curl.se\" rel=\"noopener noreferrer nofollow\">CURL<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/nginx.org\/ru\" rel=\"noopener noreferrer nofollow\">NGINX<\/a>, \u0442\u0430\u043a-\u043a\u0430\u043a \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u043d\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e, \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u0432\u0441\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/694146\/\"> https:\/\/habr.com\/ru\/post\/694146\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u044d\u0442\u043e \u043c\u043e\u044f \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0432\u044b\u0439\u0434\u0443 \u0437\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c ML \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u044e \u0432\u0430\u0441 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0432\u043e\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>\u043a\u043b\u0438\u0435\u043d\u0442\/\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432<\/strong> \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0442\u0438\u043f\u0430 <strong>HTTP<\/strong>, \u0442\u0430\u043a \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0442\u0430\u043a \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e\u0431 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0438 \u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a <a href=\"https:\/\/curl.se\/\" rel=\"noopener noreferrer nofollow\"><strong>CURL<\/strong><\/a> \u0438\u043b\u0438 <a href=\"https:\/\/nginx.org\/ru\/\" rel=\"noopener noreferrer nofollow\"><strong>NGINX<\/strong><\/a>. \u041a\u043e\u0433\u0434\u0430 \u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0412 \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0438\u0434\u0435\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u043b \u0431\u044b \u043a\u0430\u0440\u043a\u0430\u0441\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0441\u0435\u0442\u044c\u044e \u0431\u0440\u0430\u043b \u043d\u0430 \u0441\u0435\u0431\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b. \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043c\u043d\u043e\u044e \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\"><strong>AWH<\/strong><\/a>.<\/p>\n<p><strong>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 <\/strong><a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\"><strong>AWH<\/strong><\/a><strong> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>DNS \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>HTTP(S) \u043a\u043b\u0438\u0435\u043d\u0442<\/p>\n<\/li>\n<li>\n<p>WEB \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>Socks5 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>HTTPS \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>WebSocket \u043a\u043b\u0438\u0435\u043d\u0442<\/p>\n<\/li>\n<li>\n<p>WebSocket \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u0436\u0430\u0442\u0438\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Gzip\" rel=\"noopener noreferrer nofollow\">GZIP<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Deflate\" rel=\"noopener noreferrer nofollow\">DEFLATE<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/Brotli\" rel=\"noopener noreferrer nofollow\">BROTLI<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Basic_access_authentication\" rel=\"noopener noreferrer nofollow\">Basic<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B0%D0%B9%D0%B4%D0%B6%D0%B5%D1%81%D1%82-%D0%B0%D1%83%D1%82%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">Digest<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c:<\/strong><\/p>\n<ul>\n<li>\n<p>Windows (TCP, TLS, UDP, DTLS)<\/p>\n<\/li>\n<li>\n<p>Linux (TCP, TLS, UDP, DTLS, SCTP, UnixSocket)<\/p>\n<\/li>\n<li>\n<p>FreeBSD (TCP, TLS, UDP, DTLS, SCTP, UnixSocket)<\/p>\n<\/li>\n<li>\n<p>MacOS X (TCP, TLS, UDP, DTLS, UnixSocket)<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0441\u0431\u043e\u0440\u043a\u0430:<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 <a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\">AWH<\/a> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0421\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"http:\/\/software.schmorp.de\/pkg\/libev.html\" rel=\"noopener noreferrer nofollow\">LibEv<\/a> \u0434\u043b\u044f *.Nix \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u043d\u0430 <a href=\"http:\/\/www.wangafu.net\/~nickm\/libevent-2.0\/doxygen\/html\/\" rel=\"noopener noreferrer nofollow\">LibEvent2<\/a> \u0434\u043b\u044f Windows.<\/p>\n<details class=\"spoiler\">\n<summary>FreeBSD<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\"># \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 SCTP $ sudo kldload sctp  # \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 IDN2 $ .\/build_third_party.sh --idn  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_TYPE=Release \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ make  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b DTLS $ cd .\/ca $ .\/cert.sh<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Linux (Ubuntu)<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\"># \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 SCTP $ sudo apt install libsctp-dev $ modprobe sctp $ sysctl -w net.sctp.auth_enable=1  # \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 IDN2 $ .\/build_third_party.sh --idn  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_TYPE=Release \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ make  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b DTLS $ cd .\/ca $ .\/cert.sh<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>MacOS X<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"bash\"># \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 IDN2 $ .\/build_third_party.sh --idn  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_TYPE=Release \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ make  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b DTLS $ cd .\/ca $ .\/cert.sh<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Windows<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 <a href=\"https:\/\/github.com\/anyks\/awh\" rel=\"noopener noreferrer nofollow\">AWH<\/a> \u043f\u043e\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Windows \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/p>\n<p><strong>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/strong><\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/git-scm.com\" rel=\"noopener noreferrer nofollow\">GIT<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/strawberryperl.com\" rel=\"noopener noreferrer nofollow\">Perl<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.python.org\/downloads\/windows\" rel=\"noopener noreferrer nofollow\">Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.msys2.org\" rel=\"noopener noreferrer nofollow\">MSYS2<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/cmake.org\/download\" rel=\"noopener noreferrer nofollow\">CMAKE<\/a><\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 MSYS2 MinGW64<\/p>\n<pre><code class=\"bash\"># \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 $ pacman -Syuu $ pacman -S mingw64\/mingw-w64-x86_64-cmake $ pacman -S make $ pacman -S curl $ pacman -S wget $ pacman -S mc $ pacman -S gdb $ pacman -S bash $ pacman -S clang $ pacman -S git $ pacman -S --needed base-devel mingw-w64-x86_64-toolchain $ pacman -S mingw-w64-x86_64-dlfcn<\/code><\/pre>\n<pre><code class=\"bash\"># \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ git clone --recursive https:\/\/github.com\/anyks\/awh.git  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd awh  # \u0421\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 LibEvent2 $ .\/build_third_party.sh --event2  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ mkdir .\/build  # \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cd .\/build  # \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044f IDN2 \u0438 \u0420\u0435\u043b\u0438\u0437 $ cmake \\  -G \"MinGW Makefiles\" \\  -DCMAKE_BUILD_IDN=yes \\  -DCMAKE_BUILD_EVENT2=yes \\  -DCMAKE_BUILD_TYPE=Release \\  -DCMAKE_SYSTEM_NAME=Windows \\  ..  # \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 $ cmake --build .<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <strong>&#171;build&#187;<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>libawh.a<\/strong><\/p>\n<\/div>\n<\/details>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>HTTP(S) \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/rest.hpp>  using namespace std; using namespace awh;  class WebClient { private: log_t * _log; public: void active(const client::rest_t::mode_t mode, client::rest_t * web){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == client::rest_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } public: WebClient(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk); network_t nwk(&amp;fmk); uri_t uri(&amp;fmk, &amp;nwk);  WebClient executor(&amp;log);  client::core_t core(&amp;fmk, &amp;log); client::rest_t rest(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"REST Client\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.ca(\".\/ca\/cert.pem\"); \/\/ core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::TCP); core.affiliation(awh::core_t::affiliation_t::PRIMARY);  rest.mode( (uint8_t) client::rest_t::flag_t::NOINFO | (uint8_t) client::rest_t::flag_t::WAITMESS | (uint8_t) client::rest_t::flag_t::REDIRECTS | (uint8_t) client::rest_t::flag_t::VERIFYSSL ); \/\/ rest.proxy(\"http:\/\/user:password@host.com:port\"); rest.proxy(\"socks5:\/\/user:password@host.com:port\"); rest.compress(http_t::compress_t::ALL_COMPRESS); rest.on(bind(&amp;WebClient::active, &amp;executor, _1, _2));  const auto &amp; body = rest.GET(uri.parse(\"https:\/\/2ip.ru\"), {{\"User-Agent\", \"curl\/7.64.1\"}});  log.print(\"ip: %s\", log_t::flag_t::INFO, body.data());  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>Web \u0441\u0435\u0440\u0432\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;server\/rest.hpp>  using namespace std; using namespace awh;  class WebServer { private: log_t * _log; public: string password(const string &amp; login){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), \"password\"); return \"password\"; } bool auth(const string &amp; login, const string &amp; password){ this->_log->print(\"USER: %s, PASS: %s\", log_t::flag_t::INFO, login.c_str(), password.c_str()); return true; } public: bool accept(const string &amp; ip, const string &amp; mac, const u_int port, server::rest_t * web){ this->_log->print(\"ACCEPT: ip = %s, mac = %s, port = %d\", log_t::flag_t::INFO, ip.c_str(), mac.c_str(), port); return true; } void active(const size_t aid, const server::rest_t::mode_t mode, server::rest_t * web){ this->_log->print(\"%s client\", log_t::flag_t::INFO, (mode == server::rest_t::mode_t::CONNECT ? \"Connect\" : \"Disconnect\")); } void message(const size_t aid, const awh::http_t * http, server::rest_t * web){ const auto &amp; query = http->query();  if(!query.uri.empty() &amp;&amp; (query.uri.find(\"favicon.ico\") != string::npos)) web->reject(aid, 404); else if(query.method == web_t::method_t::GET){ const string body = \"&lt;html>\\n&lt;head>\\n&lt;title>Hello World!&lt;\/title>\\n&lt;\/head>\\n&lt;body>\\n\" \"&lt;h1>\\\"Hello, World!\\\" program&lt;\/h1>\\n\" \"&lt;div>\\nFrom Wikipedia, the free encyclopedia&lt;br>\\n\" \"(Redirected from Hello, world!)&lt;br>\\n\" \"Jump to navigationJump to search&lt;br>\\n\" \"&lt;strong>\\\"Hello World\\\"&lt;\/strong> redirects here. For other uses, see Hello World (disambiguation).&lt;br>\\n\" \"A &lt;strong>\\\"Hello, World!\\\"&lt;\/strong> program generally is a computer program that outputs or displays the message \\\"Hello, World!\\\".&lt;br>\\n\" \"Such a program is very simple in most programming languages, and is often used to illustrate the basic syntax of a programming language. It is often the first program written by people learning to code. It can also be used as a sanity test to make sure that computer software intended to compile or run source code is correctly installed, and that the operator understands how to use it.\\n\" \"&lt;\/div>\\n&lt;\/body>\\n&lt;\/html>\\n\"; web->response(aid, 200, \"OK\", vector &lt;char> (body.begin(), body.end())); } } public: WebServer(log_t * log) : _log(log) {} };  int main(int argc, char * argv[]){ fmk_t fmk; log_t log(&amp;fmk);  WebServer executor(&amp;log);  server::core_t core(&amp;fmk, &amp;log); server::rest_t rest(&amp;core, &amp;fmk, &amp;log);  log.setLogName(\"Web Server\"); log.setLogFormat(\"%H:%M:%S %d.%m.%Y\");  core.clusterSize(4); core.verifySSL(false); core.sonet(awh::scheme_t::sonet_t::TLS); core.affiliation(awh::core_t::affiliation_t::PRIMARY); core.certificate(\".\/ca\/certs\/server-cert.pem\", \".\/ca\/certs\/server-key.pem\");  rest.realm(\"ANYKS\"); rest.opaque(\"keySession\"); rest.authType(auth_t::type_t::DIGEST, auth_t::hash_t::MD5); rest.init(2222, \"127.0.0.1\", http_t::compress_t::ALL_COMPRESS);  rest.on((function &lt;string (const string &amp;)>) bind(&amp;WebServer::password, &amp;executor, _1)); \/\/ rest.on((function &lt;bool (const string &amp;, const string &amp;)>) bind(&amp;WebServer::auth, &amp;executor, _1, _2)); rest.on((function &lt;void (const size_t, const awh::http_t *, server::rest_t *)>) bind(&amp;WebServer::message, &amp;executor, _1, _2, _3)); rest.on((function &lt;void (const size_t, const server::rest_t::mode_t, server::rest_t *)>) bind(&amp;WebServer::active, &amp;executor, _1, _2, _3)); rest.on((function &lt;bool (const string &amp;, const string &amp;, const u_int, server::rest_t *)>) bind(&amp;WebServer::accept, &amp;executor, _1, _2, _3, _4));  rest.start();  return 0; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>WebSocket \u043a\u043b\u0438\u0435\u043d\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;client\/ws.hpp>  using namespace std; using namespace awh;  class WebSocket { private: log_t * _log; public: void active(const client::ws_t::mode_t mode, client::ws_t * ws){ this->_log->print(\"%s server\", log_t::flag_t::INFO, (mode == client::ws_t::mode_t::CONNECT ? \"Start\" : \"Stop\"));  if(mode == client::ws_t::mode_t::CONNECT){ const string query = \"{\\\"text\\\":\\\"Hello World!\\\"}\"; ws->send(query.data(),<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-339951","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339951"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339951\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}