{"id":317726,"date":"2021-02-09T15:00:21","date_gmt":"2021-02-09T15:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317726"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317726","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c web-site \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sb\/uu\/ir\/sbuuirno411hgzt3t8pisu5w9sg.png\"><br \/>  \u0421 \u043f\u0440\u0438\u0445\u043e\u0434\u043e\u043c \u0432 \u043d\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0443\u043c\u043d\u044b\u0445 \u0440\u043e\u0437\u0435\u0442\u043e\u043a, \u043b\u0430\u043c\u043f\u043e\u0447\u0435\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u043e\u0441\u043f\u043e\u0440\u0438\u043c\u043e\u0439. \u0410 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0443 lwIP (\u0438 \u0435\u0433\u043e \u043c\u043b\u0430\u0434\u0448\u0435\u043c\u0443 \u0431\u0440\u0430\u0442\u0443 uIP) \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u043d\u0438\u043a\u043e\u0433\u043e \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0448\u044c. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 lwIP \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0442\u0430\u044e\u0442 \u043e\u0442 \u0442\u0435\u0445, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438. \u0414\u0430\u0436\u0435 \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0441\u0430\u0439\u0442\u043e\u043c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u044b\u0445 \u0434\u0435\u0448\u0435\u0432\u044b\u0445 \u0440\u043e\u0443\u0442\u0435\u0440\u0430\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0430\u0439\u0442 \u043d\u0430 \u041b\u0438\u043d\u0443\u043a\u0441\u0435 \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0443\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/embox.github.io\/\">Embox<\/a>. \u0412 \u0441\u043e\u0441\u0442\u0430\u0432 \u044d\u0442\u043e\u0439 RTOS \u0432\u0445\u043e\u0434\u0438\u0442 HTTP \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 CGI. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 HTTP \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Linux \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 python HTTP \u0441\u0435\u0440\u0432\u0435\u0440.  <\/p>\n<pre><code class=\"bash\">python3 -m http.server -d &lt;site folder&gt;<\/code><\/pre>\n<h2>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0439\u0442<\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446.<br \/>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u0438 \u0432 \u043d\u0435\u0439 index.html. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0437\u0430\u0434\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u0440\u0435\u0441 \u0441\u0430\u0439\u0442\u0430.  <\/p>\n<pre><code class=\"bash\">$ ls website\/ em_big.png  index.html <\/code><\/pre>\n<p>  \u0421\u0430\u0439\u0442 \u0435\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043b\u043e\u0433\u043e\u0442\u0438\u043f Embox, \u0444\u0430\u0439\u043b \u201cem_big.png\u201d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u043c \u0432 html.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c http \u0441\u0435\u0440\u0432\u0435\u0440  <\/p>\n<pre><code class=\"bash\">python3 -m http.server -d website\/<\/code><\/pre>\n<p>  \u0417\u0430\u0439\u0434\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430 localhost:8000<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pi\/jm\/qd\/pijmqddrbpsblwumcpz6h3s-cb8.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0439\u0442 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Embox. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0432 \u043d\u0430\u0448\u0443 \u043f\u0430\u043f\u043a\u0443 \u0432 \u043f\u0430\u043f\u043a\u0443 rootfs\/ \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430 (\u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 conf\/rootfs). \u0418\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043a\u0430\u0437\u0430\u0432 \u0432 \u043d\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f rootfs.  <\/p>\n<pre><code class=\"bash\">$ ls website\/ em_big.png  index.html  Mybuild <\/code><\/pre>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 Mybuild.  <\/p>\n<pre><code class=\"plaintext\">package embox.demo  module website {     @InitFS     source &quot;index.html&quot;,         &quot;em_big.png&quot;, }<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 (\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @InitFs \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432).<\/p>\n<p>  \u041d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 mods.conf \u0438 \u0442\u0443\u0434\u0430 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c httd \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<pre><code class=\"plaintext\">    include embox.cmd.net.httpd         include embox.demo.website<\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043d\u0430\u0448\u0438\u043c \u0441\u0430\u0439\u0442\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 \u0444\u0430\u0439\u043b conf\/system_start.inc<\/p>\n<pre><code class=\"cpp\">&quot;service httpd \/&quot;,<\/code><\/pre>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u044b. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u044b. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e 192.168.2.128<\/p>\n<p>  \u0418 \u0438\u043c\u0435\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qu\/z2\/z2\/quz2z2lqabnikqyvxf1e2kjwvps.png\"><\/p>\n<p>  \u041c\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c\u0438 \u043f\u043e \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u043d\u043e \u0441\u043b\u044b\u0448\u0430\u043b\u0438, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0432\u0435\u0431 \u0441\u0430\u0439\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/AngularJS\">AngularJS<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0441 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u041d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0438\u043d\u044f\u0435\u043c\u0441\u044f \u0435\u0441\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043b\u0430\u0436\u0430\u043b\u0438 \u0441 \u0432\u0435\u0431 \u0434\u0438\u0437\u0430\u0439\u043d\u043e\u043c.<\/p>\n<p>  \u041a\u0430\u043a\u043e\u0439-\u0431\u044b \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043d\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0441\u0430\u0439\u0442\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, js \u0438\u043b\u0438 css \u0444\u0430\u0439\u043b\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 app.js (\u0441\u0430\u0439\u0442 \u043d\u0430 angular) \u0438 \u0432 \u043d\u0435\u043c \u043f\u0430\u0440\u0443 \u0432\u043a\u043b\u0430\u0434\u043e\u043a. \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 partials, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043f\u043a\u0443 images\/, \u0430 css \u0444\u0430\u0439\u043b\u044b \u0432 css\/.<\/p>\n<pre><code class=\"bash\">$ ls website\/ app.js  css  images  index.html  Mybuild  partials<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448 \u0441\u0430\u0439\u0442.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2e\/oh\/k6\/2eohk67sgl5ql3mm9szyxcpevl0.png\"><\/p>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0441\u0430\u0439\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u0435\u0435 \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435. \u041f\u0440\u0438\u0447\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u041a\u0430\u043a \u043c\u044b \u0438 \u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u0432\u0435\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439. \u0418 \u043c\u044b \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0430\u0439\u0442.<\/p>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u0435\u0431-\u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u043e\u0432. \u0422\u0430\u043a, \u043e\u0442\u043a\u0440\u044b\u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 favicon.ico:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dw\/pm\/hj\/dwpmhj1ljc7mbmr5stoqwz4dkvu.png\"><\/p>\n<p>  \u0412\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u043a\u043e\u043d\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u044d\u0442\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043d\u043e \u043f\u043e\u0440\u043e\u0439 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445, \u0433\u0434\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0430\u043b\u043e.<\/p>\n<p>  \u041f\u043e\u0438\u0441\u043a \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0432\u044b\u0434\u0430\u043b, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u0431\u0435\u0437 \u0444\u0430\u0439\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443  \u0432 head \u0441\u0435\u043a\u0446\u0438\u044e html. \u0425\u043e\u0442\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u0430, \u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u0439\u0442 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u043e. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b \u043f\u0440\u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435.<\/p>\n<h2>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442<\/h2>\n<p>  <\/p>\n<h3>CGI<\/h3>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0443. <a href=\"https:\/\/en.wikipedia.org\/wiki\/Common_Gateway_Interface\">Common Gateway Interface (CGI)<\/a> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, CGI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c CGI \u0441\u043a\u0440\u0438\u043f\u0442  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  echo -ne &quot;HTTP\/1.1 200 OK\\r\\n&quot; echo -ne &quot;Content-Type: application\/json\\r\\n&quot; echo -ne &quot;Connection: Connection: close\\r\\n&quot; echo -ne &quot;\\r\\n&quot;  tm=`LC_ALL=C date +%c` echo -ne &quot;\\&quot;$tm\\&quot;\\n\\n&quot;<\/code><\/pre>\n<p>  \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 output \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f http \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0447\u0430\u0442\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0430\u043c\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. output \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043a\u0443\u0434\u0430 \u0443\u0433\u043e\u0434\u043d\u043e. \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u0423\u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"bash\">.\/cgi-bin\/gettime HTTP\/1.1 200 OK Content-Type: application\/json Connection: Connection: close  &quot;Fri Feb  5 20:58:19 2021&quot;<\/code><\/pre>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e output \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 socket \u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  CGI \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0434\u0430\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442 cgi scripts. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u0435\u0435. \u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f CGI \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0418 \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0431 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043d\u0430 \u0421.  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;unistd.h&gt; #include &lt;string.h&gt;  int main(int argc, char *argv[]) {     char buf[128];     char *pbuf;     struct timeval tv;     time_t time;      printf(         &quot;HTTP\/1.1 200 OK\\r\\n&quot;         &quot;Content-Type: application\/json\\r\\n&quot;         &quot;Connection: Connection: close\\r\\n&quot;         &quot;\\r\\n&quot;     );       pbuf = buf;      pbuf += sprintf(pbuf, &quot;\\&quot;&quot;);      gettimeofday(&amp;tv, NULL);     time = tv.tv_sec;     ctime_r(&amp;time, pbuf);      strcat(pbuf, &quot;\\&quot;\\n\\n&quot;);      printf(&quot;%s&quot;, buf);      return 0; }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0432\u044b\u0432\u043e\u0434 \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c.<\/p>\n<p>  \u0412 \u043d\u0430\u0448 app.js \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 CGI \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438  <\/p>\n<pre><code class=\"javascript\">app.controller(&quot;SystemCtrl&quot;, ['$scope', '$http', function($scope, $http) {     $scope.time = null;      $scope.update = function() {         $http.get('cgi-bin\/gettime').then(function (r) {             $scope.time = r.data;         });     };      $scope.update(); }]);<\/code><\/pre>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u044e\u0430\u043d\u0441 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043d\u0430 Linux \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 python. \u0412 \u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 &#8212;cgi \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 CGI:  <\/p>\n<pre><code class=\"bash\">python3 -m http.server --cgi -d .<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yz\/sp\/bp\/yzspbpop0ie_nmjgpqyojtbdszu.png\"><\/p>\n<h3>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:  <\/p>\n<ul>\n<li>Server Side Includes (SSI)<\/li>\n<li>Server-sent Events (SSE)<\/li>\n<li>WebSockets<\/li>\n<li>\u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435<\/li>\n<\/ul>\n<h3>Server Side Includes (SSI).<\/h3>\n<p>  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Server_Side_Includes\">Server Side Includes (SSI)<\/a>. \u042d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u041e\u0431\u044b\u0447\u043d\u043e \u0444\u0430\u0439\u043b\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 SSI \u0438\u043c\u0435\u044e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 .shtml.<\/p>\n<p>  \u0421\u0430\u043c SSI \u0438\u043c\u0435\u0435\u0442 \u0434\u0430\u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, if else \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412 .shtml \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0441\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440  <\/p>\n<pre><code class=\"xml\">&lt;meta http-equiv=&quot;refresh&quot; content=&quot;1&quot;&gt;<\/code><\/pre>\n<p>  \u0418\u043b\u0438  <\/p>\n<pre><code class=\"xml\">&lt;BODY onLoad=&quot;window.setTimeout(&quot;location.href='runtime.shtml'&quot;,2000)&quot;&gt;<\/code><\/pre>\n<p>  \u0418 \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c. \u041d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4w\/n3\/zw\/4wn3zwt_7nuzr-syva4uw7nnzdi.gif\"><\/p>\n<p>  \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (\u0441\u043c. \u0432\u043a\u043b\u0430\u0434\u043a\u0443) \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e. \u0418 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0441\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 FreeRTOS \u2014 <a href=\"https:\/\/www.freertos.org\/FreeRTOS-For-STM32-Connectivity-Line-With-WEB-Server-Example.html\">https:\/\/www.freertos.org\/FreeRTOS-For-STM32-Connectivity-Line-With-WEB-Server-Example.html<\/a><\/p>\n<h3>Server-sent Events<\/h3>\n<p>  <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Server-sent_events\/Using_server-sent_events\">Server-sent Events (SSE)<\/a> \u044d\u0442\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0434\u0443\u043f\u043b\u0435\u043a\u0441\u043d\u043e\u0435 (\u043e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435) \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u041a\u043b\u0438\u0435\u043d\u0442 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 CGI \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u0446\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f, SSE \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u201c\u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u0439\u201d \u0440\u0435\u0436\u0438\u043c. \u0422\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u043b\u0438\u0431\u043e \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u043b\u0438\u0431\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0437\u0430\u043a\u0440\u043e\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u0439 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 CGI \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, http \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0439:  <\/p>\n<pre><code class=\"cpp\">        &quot;Content-Type: text\/event-stream\\r\\n&quot;         &quot;Cache-Control: no-cache\\r\\n&quot;         &quot;Connection: keep-alive\\r\\n&quot;<\/code><\/pre>\n<p>  Connection, \u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043d\u0435 close, \u0430 keep-alive, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c Cache-Control no-cache. \u041d\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 Content-Type text\/event-stream.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Server-sent_events\/Using_server-sent_events#examples\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f SSE<\/a>:  <\/p>\n<pre><code class=\"plaintext\">: this is a test stream  data: some text  data: another message data: with two lines <\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443  <\/p>\n<pre><code class=\"plaintext\">data: { \u201ctime\u201d: \u201c&lt;real date&gt;\u201d}<\/code><\/pre>\n<p>  \u041d\u0430\u0448 CGI \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  echo -ne &quot;HTTP\/1.1 200 OK\\r\\n&quot; echo -ne &quot;Content-Type: text\/event-stream\\r\\n&quot; echo -ne &quot;Cache-Control: no-cache\\r\\n&quot; echo -ne &quot;Connection: keep-alive\\r\\n&quot; echo -ne &quot;\\r\\n&quot;  while true; do     tm=`LC_ALL=C date +%c`     echo -ne &quot;data: {\\&quot;time\\&quot; : \\&quot;$tm\\&quot;}\\n\\n&quot; 2&gt;\/dev\/null || exit 0     sleep 1 done<\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442  <\/p>\n<pre><code class=\"bash\">$ .\/cgi-bin\/gettime HTTP\/1.1 200 OK Content-Type: text\/event-stream Cache-Control: no-cache Connection: keep-alive  data: {&quot;time&quot; : &quot;Fri Feb  5 21:48:11 2021&quot;}  data: {&quot;time&quot; : &quot;Fri Feb  5 21:48:12 2021&quot;}  data: {&quot;time&quot; : &quot;Fri Feb  5 21:48:13 2021&quot;}<\/code><\/pre>\n<p>  \u0418 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u0440\u0430\u0437 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443<\/p>\n<p>  \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430 \u0421  <\/p>\n<pre><code class=\"cpp\">#include &lt;stdio.h&gt; #include &lt;unistd.h&gt; #include &lt;string.h&gt;  int main(int argc, char *argv[]) {     char buf[128];     char *pbuf;     struct timeval tv;     time_t time;      printf(         &quot;HTTP\/1.1 200 OK\\r\\n&quot;         &quot;Content-Type: text\/event-stream\\r\\n&quot;         &quot;Cache-Control: no-cache\\r\\n&quot;         &quot;Connection: keep-alive\\r\\n&quot;         &quot;\\r\\n&quot;     );      while (1) {         pbuf = buf;          pbuf += sprintf(pbuf, &quot;data: {\\&quot;time\\&quot; : \\&quot;&quot;);          gettimeofday(&amp;tv, NULL);         time = tv.tv_sec;         ctime_r(&amp;time, pbuf);          strcat(pbuf, &quot;\\&quot;}\\n\\n&quot;);          if (0 &gt; printf(&quot;%s&quot;, buf)) {             break;         }          sleep(1);     }      return 0; } <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0443\u0436\u043d\u043e \u0435\u0449\u0435 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c angular, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 SSE, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430  <\/p>\n<pre><code class=\"javascript\">app.controller(&quot;SystemCtrl&quot;, ['$scope', '$http', function($scope, $http) {     $scope.time = null;      var eventCallbackTime = function (msg) {         $scope.$apply(function () {             $scope.time = JSON.parse(msg.data).time         });     }      var source_time = new EventSource('\/cgi-bin\/gettime');     source_time.addEventListener('message', eventCallbackTime);      $scope.$on('$destroy', function () {         source_time.close();     });      $scope.update = function() {     };      $scope.update(); }]);<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0430\u0439\u0442, \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b0\/fa\/h4\/b0fah456vx3jvgeyt00x2swf-i0.gif\"><\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f SSI, \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f, \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043b\u0430\u0432\u043d\u043e \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0433\u043b\u0430\u0437\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f.<\/p>\n<h2>\u0414\u0435\u043c\u043e<\/h2>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435. \u0418\u0445 \u0446\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0438 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0443\u0433\u043b\u043e\u0432\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u0433\u0438\u0440\u043e\u0441\u043a\u043e\u043f\u0430) \u0438 \u0432\u043a\u043b\u0430\u0434\u043a\u043e\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0430\u0439\u0442\u0430 \u0432\u0435\u043b\u0430\u0441\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u0434\u043b\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430. \u0414\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 RANDOM  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  echo -ne &quot;HTTP\/1.1 200 OK\\r\\n&quot; echo -ne &quot;Content-Type: text\/event-stream\\r\\n&quot; echo -ne &quot;Cache-Control: no-cache\\r\\n&quot; echo -ne &quot;Connection: keep-alive\\r\\n&quot; echo -ne &quot;\\r\\n&quot;  while true; do     x=$((1 + $RANDOM % 15000))     y=$((1 + $RANDOM % 15000))     z=$((1 + $RANDOM % 15000))     echo -ne &quot;data: {\\&quot;rate\\&quot; : \\&quot;x:$x y:$y z:$z\\&quot;}\\n\\n&quot; 2&gt;\/dev\/null || exit 0     sleep 1 done<\/code><\/pre>\n<p>  \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0444\u0430\u0439\u043b\u0435.  <\/p>\n<pre><code class=\"python\">#!\/bin\/python3  import cgi import sys  print(&quot;HTTP\/1.1 200 OK&quot;) print(&quot;Content-Type: text\/plain&quot;) print(&quot;Connection: close&quot;) print()  form = cgi.FieldStorage() cmd = form['cmd'].value  if cmd == 'serialize_states':     with open('cgi-bin\/leds.txt', 'r') as f:         print('[' + f.read() + ']')  elif cmd == 'clr' or cmd == 'set':     led_nr = int(form['led'].value)      with open('cgi-bin\/leds.txt', 'r+') as f:         leds = f.read().split(',')         leds[led_nr] = str(1 if cmd == 'set' else 0)         f.seek(0)         f.write(','.join(leds))<\/code><\/pre>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0438 \u0432 C \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0432 <a href=\"https:\/\/github.com\/embox\/embox\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> \u043f\u0430\u043f\u043a\u0430 (project\/website).<\/p>\n<p>  \u041d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043e\u0442\u043b\u0430\u0436\u0435\u043d\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0430\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043d\u0435 \u0437\u0430\u043d\u044f\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  \u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wa\/oi\/jv\/waoijvxhrxvxtng_gfoiw5h65yu.png\"><\/p>\n<p>  \u041d\u0430 \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u043c \u0432\u0438\u0434\u0435\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e http, \u043d\u043e \u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0434\u0430\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ntp \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 Embox, \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0441 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0435\u0439.  <\/p>\n<div class=\"oembed\"><iframe allowfullscreen id=\"60229dbf30f707d266c0ec3d\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/60229dbf30f707d266c0ec3d\"><\/iframe><\/div>\n<p>  \u0421\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043f\u043e <a href=\"https:\/\/github.com\/embox\/embox\/wiki\/Control-LEDs-and-receiving-data-from-an-gyroscope-over-HTTP\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0432\u0438\u043a\u0438<\/a><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445. \u041f\u0440\u0438\u0447\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434 \u0445\u043e\u0441\u0442 \u0438 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0437 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u0430\u0439\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0431-\u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a embedded \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0427\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u043d\u0430 \u0440\u044b\u043d\u043e\u043a.<\/p>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430 \u044d\u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0414\u0430 SSE \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0447\u0435\u043c SSI. \u041d\u043e \u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Embox \u043b\u0435\u0433\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0441\u044c \u0432 STM32F4 \u043f\u0440\u0438\u0447\u0435\u043c \u0431\u0435\u0437 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u0441\u0435\u0433\u043e 128 \u043a\u0431 \u041e\u0417\u0423. \u041c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0441\u0442\u0430\u043b\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0435 \u0442\u0430\u043a\u0438\u0435 \u0443\u0436 \u0431\u043e\u043b\u044c\u0448\u0438\u0435. \u0410 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0448\u0435. \u0418 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0441\u043b\u0438 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u0412\u0435\u0434\u044c \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u044b\u0442\u044c \u0432\u0441\u0435 \u0431\u043e\u043b\u0435\u0435 \u0443\u043c\u043d\u044b\u043c\u0438.<\/p><\/div>\n<p> \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\/company\/embox\/blog\/541662\/\"> https:\/\/habr.com\/ru\/company\/embox\/blog\/541662\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sb\/uu\/ir\/sbuuirno411hgzt3t8pisu5w9sg.png\"><br \/>  \u0421 \u043f\u0440\u0438\u0445\u043e\u0434\u043e\u043c \u0432 \u043d\u0430\u0448\u0443 \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0443\u043c\u043d\u044b\u0445 \u0440\u043e\u0437\u0435\u0442\u043e\u043a, \u043b\u0430\u043c\u043f\u043e\u0447\u0435\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u043e\u0441\u043f\u043e\u0440\u0438\u043c\u043e\u0439. \u0410 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0443 lwIP (\u0438 \u0435\u0433\u043e \u043c\u043b\u0430\u0434\u0448\u0435\u043c\u0443 \u0431\u0440\u0430\u0442\u0443 uIP) \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u043d\u0438\u043a\u043e\u0433\u043e \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0448\u044c. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 lwIP \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u0438\u0437\u0430\u0439\u043d\u0430, \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u0442\u0430\u044e\u0442 \u043e\u0442 \u0442\u0435\u0445, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438. \u0414\u0430\u0436\u0435 \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0441\u0430\u0439\u0442\u043e\u043c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u044b\u0445 \u0434\u0435\u0448\u0435\u0432\u044b\u0445 \u0440\u043e\u0443\u0442\u0435\u0440\u0430\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0430\u0439\u0442 \u043d\u0430 \u041b\u0438\u043d\u0443\u043a\u0441\u0435 \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0443\u043c\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435.  <\/p>\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-317726","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317726","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=317726"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317726\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}