{"id":2407,"date":"2026-09-19T05:56:34","date_gmt":"2026-09-19T05:56:34","guid":{"rendered":"https:\/\/otus.ru\/journal\/?p=2407"},"modified":"2026-09-25T15:42:58","modified_gmt":"2026-09-25T15:42:58","slug":"http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata","status":"publish","type":"post","link":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/","title":{"rendered":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043d\u0430 HttpServer"},"content":{"rendered":"<p><strong>HTTP-\u0441\u0435\u0440\u0432\u0435\u0440<\/strong> &#8212; \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e \u043d\u0438\u043c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u044b. \u0412 Java \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0430 \u0442\u0440\u0435\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445: \u0441\u044b\u0440\u043e\u0439 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Socket<\/code>, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">com.sun.net.httpserver.HttpServer<\/code> \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u0434 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c. \u0414\u0430\u043b\u044c\u0448\u0435 &#8212; \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 HttpServer, \u0441 \u043f\u0440\u043e\u0433\u043e\u0432\u043e\u0440\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<div class=\"oj-toc\" style=\"background:#f6f6f6;border-radius:8px;padding:14px 20px;margin:20px 0\">\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/strong><\/p>\n<ol>\n<li><a href=\"#s1\">\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u044b<\/a><\/li>\n<li><a href=\"#s2\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 HttpServer<\/a><\/li>\n<li><a href=\"#s3\">\u0422\u043e\u0442 \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0441\u044b\u0440\u043e\u043c Socket<\/a><\/li>\n<li><a href=\"#s4\">\u0423\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 HttpServer<\/a><\/li>\n<li><a href=\"#s5\">\u0413\u0434\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u0430: \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0434-\u0441\u0435\u0440\u0432\u0435\u0440<\/a><\/li>\n<li><a href=\"#s6\">\u0412\u044b\u0432\u043e\u0434\u044b<\/a><\/li>\n<li><a href=\"#s7\">\u0413\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \/ \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439<\/a><\/li>\n<li><a href=\"#s8\">FAQ<\/a><\/li>\n<\/ol>\n<\/div>\n<h2 id=\"s1\">\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u044b<\/h2>\n<p>\u042d\u0442\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u0447\u0430\u0441\u0442\u043e \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u044e\u0442, \u0445\u043e\u0442\u044f \u043e\u043d\u0438 \u0440\u0435\u0448\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li><strong>\u0421\u043e\u043a\u0435\u0442<\/strong> (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">java.net.ServerSocket<\/code>) &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442, \u043f\u043e\u0442\u043e\u043a \u0431\u0430\u0439\u0442 \u043f\u043e TCP. HTTP \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u0438: \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0442\u0435\u043b\u043e.<\/li>\n<li><strong>HttpServer<\/strong> (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">com.sun.net.httpserver.HttpServer<\/code>) &#8212; \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f HTTP-\u043e\u0431\u0432\u044f\u0437\u043a\u0430 \u0438\u0437 \u0441\u043e\u0441\u0442\u0430\u0432\u0430 JDK. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0430\u043c, \u0440\u043e\u0443\u0442\u0438\u043d\u0433 &#8212; \u043f\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0443 \u043f\u0443\u0442\u0438 (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">createContext<\/code>).<\/li>\n<li><strong>\u0421\u0435\u0440\u0432\u043b\u0435\u0442<\/strong> (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServlet<\/code>) &#8212; \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u0440\u043e\u0434\u0435 Tomcat: \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u0441\u0435\u0441\u0441\u0438\u0438, \u0444\u0438\u043b\u044c\u0442\u0440\u044b.<\/li>\n<li><strong>\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a<\/strong> (Spring Boot \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438) &#8212; \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0430\u0434 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438\u043b\u0438 Netty: \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, DI, \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>\u0423\u0440\u043e\u0432\u0435\u043d\u044c<\/th>\n<th>\u0427\u0442\u043e \u0434\u0430\u0435\u0442<\/th>\n<th>\u0427\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0435 \u0441\u0430\u043c\u0438<\/th>\n<th>\u041f\u0440\u0438\u043c\u0435\u0440<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Socket<\/td>\n<td>TCP-\u043f\u043e\u0442\u043e\u043a<\/td>\n<td>\u0420\u0430\u0437\u0431\u043e\u0440 HTTP, keep-alive<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">new ServerSocket(8002)<\/code><\/td>\n<\/tr>\n<tr>\n<td>HttpServer<\/td>\n<td>\u0420\u0430\u0437\u0431\u043e\u0440 HTTP, \u0440\u043e\u0443\u0442\u0438\u043d\u0433<\/td>\n<td>\u041b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer.create(...)<\/code><\/td>\n<\/tr>\n<tr>\n<td>Servlet + \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/td>\n<td>\u0421\u0435\u0441\u0441\u0438\u0438, \u0444\u0438\u043b\u044c\u0442\u0440\u044b<\/td>\n<td>\u041a\u043b\u0430\u0441\u0441-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServlet.doGet()<\/code><\/td>\n<\/tr>\n<tr>\n<td>Spring Boot<\/td>\n<td>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, DI<\/td>\n<td>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">@RestController<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 &#8212; \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430 \u043a\u043e\u0434\u0435: \u043e\u043d\u0438 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 JDK \u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 &#171;\u0441\u0435\u0440\u0432\u0435\u0440&#187; \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c.<\/p>\n<h2 id=\"s2\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 HttpServer<\/h2>\n<p><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer<\/code> &#8212; \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jdk.httpserver<\/code>, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043b\u044e\u0431\u043e\u043c JDK \u0431\u0435\u0437 Maven \u0438 Gradle. \u041f\u043e\u043b\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">com.sun.net.httpserver.HttpExchange<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">com.sun.net.httpserver.HttpHandler<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">com.sun.net.httpserver.HttpServer<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.IOException<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.OutputStream<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.net.InetSocketAddress<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.nio.charset.StandardCharsets<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.concurrent.Executors<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">SimpleHttpServer<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">main<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">args<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">HttpServer<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">HttpServer<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">create<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">InetSocketAddress<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"localhost\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">8001<\/span><span style=\"color: #ABB2BF\">), <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">createContext<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\/hello\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">HelloHandler<\/span><span style=\"color: #ABB2BF\">());<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">setExecutor<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">Executors<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">newFixedThreadPool<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">10<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">start<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0421\u0435\u0440\u0432\u0435\u0440 \u0437\u0430\u043f\u0443\u0449\u0435\u043d: http:\/\/localhost:8001\/hello\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">HelloHandler<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">implements<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">HttpHandler<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #61AFEF\">@Override<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">handle<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">HttpExchange<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E5C07B\">byte<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\u041f\u0440\u0438\u0432\u0435\u0442 \u043e\u0442 HttpServer!\"<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getBytes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">StandardCharsets<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">UTF_8<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">sendResponseHeaders<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">200<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">length<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #C678DD\">try<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">OutputStream<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">os<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getResponseBody<\/span><span style=\"color: #ABB2BF\">()) {<\/span>\n<span style=\"color: #ABB2BF\">                <\/span><span style=\"color: #E06C75\">os<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">write<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            }<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">javac SimpleHttpServer.java<\/code>, \u0437\u0430\u0442\u0435\u043c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">java SimpleHttpServer<\/code>. \u0417\u0430\u043f\u0440\u043e\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">curl http:\/\/localhost:8001\/hello<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u0442\u0435\u043b\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\u041f\u0440\u0438\u0432\u0435\u0442 \u043e\u0442 HttpServer!<\/code> \u0441 \u043a\u043e\u0434\u043e\u043c 200.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer.create(addr, 0)<\/code> &#8212; \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 (backlog); 0 \u0437\u043d\u0430\u0447\u0438\u0442 &#171;\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e&#187;, \u0430 \u043d\u0435 &#171;\u0431\u0435\u0437 \u043e\u0447\u0435\u0440\u0435\u0434\u0438&#187;. <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">createContext<\/code> \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0443 \u043f\u0443\u0442\u0438 \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">setExecutor<\/code> \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u0443\u043b \u043f\u043e\u0442\u043e\u043a\u043e\u0432 &#8212; \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0432 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a. \u0412 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">handle()<\/code> \u0442\u0435\u043b\u043e \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">OutputStream<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f &#8212; \u0438\u043d\u0430\u0447\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/p>\n<h2 id=\"s3\">\u0422\u043e\u0442 \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0441\u044b\u0440\u043e\u043c Socket<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer<\/code>, \u0432\u043e\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 \u043d\u0430 \u0433\u043e\u043b\u043e\u043c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">ServerSocket<\/code>, \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439 HTTP-\u043e\u0442\u0432\u0435\u0442:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.BufferedReader<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.IOException<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.InputStreamReader<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.OutputStream<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.net.ServerSocket<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.net.Socket<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.nio.charset.StandardCharsets<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">SimpleSocketServer<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">main<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">args<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">try<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">ServerSocket<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">serverSocket<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">ServerSocket<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">8002<\/span><span style=\"color: #ABB2BF\">)) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0421\u043e\u043a\u0435\u0442-\u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043f\u043e\u0440\u0442 8002\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #C678DD\">while<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E5C07B\">true<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">                <\/span><span style=\"color: #E06C75\">Socket<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">client<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">serverSocket<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">accept<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">                <\/span><span style=\"color: #E06C75\">handle<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">client<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            }<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">handle<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">Socket<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">client<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">try<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">client<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">             <\/span><span style=\"color: #E06C75\">BufferedReader<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">in<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">BufferedReader<\/span><span style=\"color: #ABB2BF\">(<\/span>\n<span style=\"color: #ABB2BF\">                     <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">InputStreamReader<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">client<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getInputStream<\/span><span style=\"color: #ABB2BF\">(), <\/span><span style=\"color: #E06C75\">StandardCharsets<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">UTF_8<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">             <\/span><span style=\"color: #E06C75\">OutputStream<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">client<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getOutputStream<\/span><span style=\"color: #ABB2BF\">()) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">requestLine<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">in<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">readLine<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0417\u0430\u043f\u0440\u043e\u0441: \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">requestLine<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\u041f\u0440\u0438\u0432\u0435\u0442 \u043e\u0442 \u0441\u044b\u0440\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430!\"<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E5C07B\">byte<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">bodyBytes<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getBytes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">StandardCharsets<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">UTF_8<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"HTTP\/1.1 200 OK\\r\\n\"<\/span>\n<span style=\"color: #ABB2BF\">                    <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"Content-Type: text\/plain; charset=utf-8\\r\\n\"<\/span>\n<span style=\"color: #ABB2BF\">                    <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"Content-Length: \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">bodyBytes<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">length<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\\r\\n\"<\/span>\n<span style=\"color: #ABB2BF\">                    <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\\r\\n\"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">write<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getBytes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">StandardCharsets<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">UTF_8<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">javac SimpleSocketServer.java &amp;&amp; java SimpleSocketServer<\/code>. \u0417\u0430\u043f\u0440\u043e\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">curl http:\/\/localhost:8002\/<\/code> \u0432\u044b\u0432\u0435\u0434\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\u041f\u0440\u0438\u0432\u0435\u0442 \u043e\u0442 \u0441\u044b\u0440\u043e\u0433\u043e \u0441\u043e\u043a\u0435\u0442\u0430!<\/code>, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\u0417\u0430\u043f\u0440\u043e\u0441: GET \/ HTTP\/1.1<\/code>.<\/p>\n<p>\u0413\u0440\u0430\u043d\u0438\u0446\u0430: \u043a\u043e\u0434 \u0447\u0438\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0442\u0435\u043b\u043e &#8212; \u0434\u043b\u044f POST \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Content-Length<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0440\u0443\u0442\u0438\u043d\u0443 \u0438 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer<\/code>.<\/p>\n<h2 id=\"s4\">\u0423\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 HttpServer<\/h2>\n<p>\u0427\u0430\u0442 &#8212; \u0442\u043e\u0442 \u0436\u0435 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u0434\u0432\u0443\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438: \u043f\u0440\u0438\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u0434\u0430\u0447\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u0431\u0435\u0437 WebSocket:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">com.sun.net.httpserver.HttpExchange<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">com.sun.net.httpserver.HttpServer<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.IOException<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.io.OutputStream<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.net.InetSocketAddress<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.nio.charset.StandardCharsets<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.List<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.concurrent.CopyOnWriteArrayList<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #C678DD\">import<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">java.util.concurrent.Executors<\/span><span style=\"color: #ABB2BF\">;<\/span>\n\n<span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">class<\/span> <span style=\"color: #E5C07B\">ChatServer<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">final<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">List<\/span><span style=\"color: #56B6C2\">&lt;<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">&gt;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">messages<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">CopyOnWriteArrayList<\/span><span style=\"color: #56B6C2\">&lt;&gt;<\/span><span style=\"color: #ABB2BF\">();<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">public<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">main<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">args<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">HttpServer<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">HttpServer<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">create<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">InetSocketAddress<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"localhost\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">8003<\/span><span style=\"color: #ABB2BF\">), <\/span><span style=\"color: #D19A66\">0<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">createContext<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\/chat\/send\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">ChatServer<\/span><span style=\"color: #ABB2BF\">::<\/span><span style=\"color: #E06C75\">handleSend<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">createContext<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\/chat\/history\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">ChatServer<\/span><span style=\"color: #ABB2BF\">::<\/span><span style=\"color: #E06C75\">handleHistory<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">setExecutor<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">Executors<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">newFixedThreadPool<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">10<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">server<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">start<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">System<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">out<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">println<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0427\u0430\u0442-\u0441\u0435\u0440\u0432\u0435\u0440: http:\/\/localhost:8003\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">handleSend<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">HttpExchange<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #56B6C2\">!<\/span><span style=\"color: #98C379\">\"POST\"<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">equals<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getRequestMethod<\/span><span style=\"color: #ABB2BF\">())) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">sendResponseHeaders<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">405<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #56B6C2\">-<\/span><span style=\"color: #D19A66\">1<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getRequestBody<\/span><span style=\"color: #ABB2BF\">().<\/span><span style=\"color: #E06C75\">readAllBytes<\/span><span style=\"color: #ABB2BF\">(), <\/span><span style=\"color: #E06C75\">StandardCharsets<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">UTF_8<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">messages<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">add<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">respond<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #98C379\">\"ok\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">handleHistory<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">HttpExchange<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">respond<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">join<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\\n\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">messages<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">private<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">static<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">void<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #61AFEF; font-weight: bold\">respond<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">HttpExchange<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">String<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">throws<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">IOException<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E5C07B\">byte<\/span><span style=\"color: #56B6C2\">[]<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getBytes<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">StandardCharsets<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">UTF_8<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">sendResponseHeaders<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">200<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">length<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">try<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">OutputStream<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">os<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">exchange<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">getResponseBody<\/span><span style=\"color: #ABB2BF\">()) {<\/span>\n<span style=\"color: #ABB2BF\">            <\/span><span style=\"color: #E06C75\">os<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">write<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        }<\/span>\n<span style=\"color: #ABB2BF\">    }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">curl -X POST --data \"\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c\" http:\/\/localhost:8003\/chat\/send<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">ok<\/code>, \u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">curl http:\/\/localhost:8003\/chat\/history<\/code> \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0435\u0440\u043d\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c<\/code>. \u042d\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u043e\u043f\u0440\u043e\u0441\u043e\u043c (polling): \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0430\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\/chat\/history<\/code>, \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 &#171;\u0442\u043e\u043b\u043a\u0430\u0435\u0442&#187; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u0430\u043c. \u041c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u0443\u044e \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443 \u0431\u0435\u0437 \u043e\u043f\u0440\u043e\u0441\u0430 \u0434\u0430\u0435\u0442 WebSocket &#8212; \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e.<\/p>\n<h2 id=\"s5\">\u0413\u0434\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0433\u0440\u0430\u043d\u0438\u0446\u0430: \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0434-\u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer<\/code> \u0438 \u0433\u043e\u043b\u044b\u0439 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Socket<\/code> \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0434-\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438: \u0431\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">setExecutor<\/code> \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0434\u0435\u0442 \u0432 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a, \u043d\u0435\u0442 TLS \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 (\u043d\u0443\u0436\u0435\u043d <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpsServer<\/code> \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">SSLContext<\/code>), \u043d\u0435\u0442 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u043e\u0432 \u0438 \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u043d\u0430 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0447\u0430\u0442\u0430 \u0436\u0438\u0432\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u0435\u0437 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0420\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c (Tomcat, Jetty) \u0438\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c (Spring Boot), \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430 reverse-proxy \u0432\u0440\u043e\u0434\u0435 nginx, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0435\u0440\u0435\u0442 TLS \u0438 \u0447\u0430\u0441\u0442\u044c \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0431\u044f.<\/p>\n<h2 id=\"s6\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<ul>\n<li>HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u0432 Java \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430 \u0442\u0440\u0435\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445: \u0441\u044b\u0440\u043e\u0439 Socket, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 HttpServer \u0438\u0437 JDK, \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\/\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a &#8212; \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0432\u043e\u044f \u0437\u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438.<\/li>\n<li><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer<\/code> \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 HTTP \u0437\u0430 \u0432\u0430\u0441 \u0431\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">setExecutor<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a.<\/li>\n<li>\u0423\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 &#8212; \u0434\u0432\u0430 HTTP-\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (\u043f\u0440\u0438\u0435\u043c \u0438 \u0432\u044b\u0434\u0430\u0447\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438) \u043f\u043e\u0432\u0435\u0440\u0445 HttpServer, \u0431\u0435\u0437 WebSocket, \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0440\u043e\u0441, \u0430 \u043d\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u0443\u044e \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443.<\/li>\n<li>\u041d\u0438 Socket-, \u043d\u0438 HttpServer-\u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0443: \u043d\u0435\u0442 TLS, \u043b\u0438\u043c\u0438\u0442\u043e\u0432 \u0438 \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/li>\n<\/ul>\n<h2 id=\"s7\">\u0413\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \/ \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439<\/h2>\n<div class=\"oj-cta\" style=\"background:#fbf4e4;border-left:4px solid #c9962b;border-radius:8px;padding:16px 20px;margin:24px 0\">\n<p style=\"margin:0 0 8px\"><strong>\u041e\u0441\u0432\u043e\u0439\u0442\u0435 \u0442\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/strong><\/p>\n<p>\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 &#8212; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u0445\u043e\u0434 \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430 Java, \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438 \u043f\u0435\u0440\u0435\u0434 Spring Boot, \u0438 \u043f\u0435\u0440\u0435\u0434 Netty. \u041f\u0440\u043e\u0439\u0442\u0438 \u043f\u0443\u0442\u044c \u043e\u0442 \u0441\u043e\u043a\u0435\u0442\u043e\u0432 \u0438 HttpServer \u0434\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e, \u0441 \u0440\u0430\u0437\u0431\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432, Spring \u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/otus.ru\/lessons\/java-basic\/?int_article=http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata&amp;int_place=article&amp;int_variant=v1\">Java Backend Developer<\/a>. \u0421\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 <a href=\"https:\/\/otus.ru\/events\/?int_article=http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata&amp;int_place=article&amp;int_variant=v1\">\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0443\u0440\u043e\u043a\u0438 Otus<\/a>.<\/p>\n<\/div>\n<h2 id=\"s8\">FAQ<\/h2>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u044c com.sun.net.httpserver.HttpServer \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d?<\/strong><br \/>\n\u041d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f: \u043d\u0435\u0442 TLS \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043a\u0430\u043a \u0443 Tomcat, Jetty \u0438\u043b\u0438 Netty. \u0413\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041d\u0443\u0436\u043d\u044b \u043b\u0438 Maven \u0438\u043b\u0438 Gradle \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438?<\/strong><br \/>\n\u041d\u0435\u0442, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpServer<\/code> \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 JDK (\u043c\u043e\u0434\u0443\u043b\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jdk.httpserver<\/code>), \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">javac<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">java<\/code>.<\/p>\n<p><strong>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c HTTPS \u043a HttpServer?<\/strong><br \/>\n\u0427\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">HttpsServer<\/code> \u0438\u0437 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">SSLContext<\/code> \u043f\u043e\u0434 \u0432\u0430\u0448 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 &#8212; \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 TCP-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e \u043d\u0438\u043c HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u044b. \u0412 Java \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043d\u0430 \u0442\u0440\u0435\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445: \u0441\u044b\u0440\u043e\u0439 Socket, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 com.sun.net.httpserver.HttpServer \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u043e\u0434 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c. \u0414\u0430\u043b\u044c\u0448\u0435 &#8212; \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 HttpServer, \u0441 \u043f\u0440\u043e\u0433\u043e\u0432\u043e\u0440\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u044b [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":2408,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[75],"class_list":["post-2407","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-polza","tag-java"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0443\u0440\u043e\u0432\u043d\u0438 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u0441\u044b\u0440\u043e\u0439 Socket, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 com.sun.net.httpserver.HttpServer \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u0447\u0430\u0442\u0430.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"A. Pavlenko\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#article\",\"name\":\"HTTP-\\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u043d\\u0430 Java: \\u043f\\u0438\\u0448\\u0435\\u043c \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u0438 \\u0447\\u0430\\u0442 | Otus\",\"headline\":\"HTTP-\\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u043d\\u0430 Java: \\u043f\\u0438\\u0448\\u0435\\u043c \\u0441\\u0432\\u043e\\u0439 \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u0438 \\u0443\\u0447\\u0435\\u0431\\u043d\\u044b\\u0439 \\u0447\\u0430\\u0442 \\u043d\\u0430 HttpServer\",\"author\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/oj-1080x720-5.png\",\"width\":1080,\"height\":720},\"datePublished\":\"2026-09-19T05:56:34+00:00\",\"dateModified\":\"2026-09-25T15:42:58+00:00\",\"inLanguage\":\"ru-RU\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#webpage\"},\"articleSection\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435, Java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"position\":2,\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\",\"item\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#listItem\",\"name\":\"HTTP-\\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u043d\\u0430 Java: \\u043f\\u0438\\u0448\\u0435\\u043c \\u0441\\u0432\\u043e\\u0439 \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u0438 \\u0443\\u0447\\u0435\\u0431\\u043d\\u044b\\u0439 \\u0447\\u0430\\u0442 \\u043d\\u0430 HttpServer\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#listItem\",\"position\":3,\"name\":\"HTTP-\\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u043d\\u0430 Java: \\u043f\\u0438\\u0448\\u0435\\u043c \\u0441\\u0432\\u043e\\u0439 \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u0438 \\u0443\\u0447\\u0435\\u0431\\u043d\\u044b\\u0439 \\u0447\\u0430\\u0442 \\u043d\\u0430 HttpServer\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\",\"name\":\"\\u041e\\u0442\\u0443\\u0441 \\u043e\\u043d\\u043b\\u0430\\u0439\\u043d-\\u043e\\u0431\\u0440\\u0430\\u0437\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435\",\"description\":\"\\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"telephone\":\"+74999389202\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/OTUS-journal-logo-180x180-1.png\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#organizationLogo\",\"width\":180,\"height\":180},\"image\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCetgtvy93o3i3CvyGXKFU3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/\",\"name\":\"A. Pavlenko\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/13488c7d5b657aaaf1808afd398f71e0225df07dd94eb7e5fcdfc45feff43cb5?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"A. Pavlenko\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#webpage\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/\",\"name\":\"HTTP-\\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u043d\\u0430 Java: \\u043f\\u0438\\u0448\\u0435\\u043c \\u0441\\u0435\\u0440\\u0432\\u0435\\u0440 \\u0438 \\u0447\\u0430\\u0442 | Otus\",\"description\":\"\\u0420\\u0430\\u0437\\u0431\\u0438\\u0440\\u0430\\u044e \\u0443\\u0440\\u043e\\u0432\\u043d\\u0438 HTTP-\\u0441\\u0435\\u0440\\u0432\\u0435\\u0440\\u0430 \\u0432 Java: \\u0441\\u044b\\u0440\\u043e\\u0439 Socket, \\u0432\\u0441\\u0442\\u0440\\u043e\\u0435\\u043d\\u043d\\u044b\\u0439 com.sun.net.httpserver.HttpServer \\u0438 \\u0441\\u0435\\u0440\\u0432\\u043b\\u0435\\u0442-\\u043a\\u043e\\u043d\\u0442\\u0435\\u0439\\u043d\\u0435\\u0440, \\u043d\\u0430 \\u043f\\u0440\\u0438\\u043c\\u0435\\u0440\\u0435 \\u0440\\u0430\\u0431\\u043e\\u0447\\u0435\\u0433\\u043e \\u043a\\u043e\\u0434\\u0430 \\u0438 \\u0443\\u0447\\u0435\\u0431\\u043d\\u043e\\u0433\\u043e \\u0447\\u0430\\u0442\\u0430.\",\"inLanguage\":\"ru-RU\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/oj-1080x720-5.png\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#mainImage\",\"width\":1080,\"height\":720},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\\\/#mainImage\"},\"datePublished\":\"2026-09-19T05:56:34+00:00\",\"dateModified\":\"2026-09-25T15:42:58+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#website\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"name\":\"OTUS \\u0416\\u0443\\u0440\\u043d\\u0430\\u043b - \\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"alternateName\":\"OTUS \\u0416\\u0443\\u0440\\u043d\\u0430\\u043b\",\"description\":\"\\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"inLanguage\":\"ru-RU\",\"publisher\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0447\u0430\u0442 | Otus","description":"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0443\u0440\u043e\u0432\u043d\u0438 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u0441\u044b\u0440\u043e\u0439 Socket, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 com.sun.net.httpserver.HttpServer \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u0447\u0430\u0442\u0430.","canonical_url":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#article","name":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0447\u0430\u0442 | Otus","headline":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043d\u0430 HttpServer","author":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"publisher":{"@id":"https:\/\/otus.ru\/journal\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2021\/11\/oj-1080x720-5.png","width":1080,"height":720},"datePublished":"2026-09-19T05:56:34+00:00","dateModified":"2026-09-25T15:42:58+00:00","inLanguage":"ru-RU","mainEntityOfPage":{"@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#webpage"},"isPartOf":{"@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#webpage"},"articleSection":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435, Java"},{"@type":"BreadcrumbList","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/#listItem","position":1,"name":"Home","item":"https:\/\/otus.ru\/journal\/","nextItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"}},{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","position":2,"name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435","item":"https:\/\/otus.ru\/journal\/category\/polza\/","nextItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#listItem","name":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043d\u0430 HttpServer"},"previousItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#listItem","position":3,"name":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043d\u0430 HttpServer","previousItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"}}]},{"@type":"Organization","@id":"https:\/\/otus.ru\/journal\/#organization","name":"\u041e\u0442\u0443\u0441 \u043e\u043d\u043b\u0430\u0439\u043d-\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435","description":"\u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","url":"https:\/\/otus.ru\/journal\/","telephone":"+74999389202","logo":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2026\/04\/OTUS-journal-logo-180x180-1.png","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#organizationLogo","width":180,"height":180},"image":{"@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#organizationLogo"},"sameAs":["https:\/\/www.youtube.com\/channel\/UCetgtvy93o3i3CvyGXKFU3g"]},{"@type":"Person","@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author","url":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/","name":"A. Pavlenko","image":{"@type":"ImageObject","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/13488c7d5b657aaaf1808afd398f71e0225df07dd94eb7e5fcdfc45feff43cb5?s=96&d=mm&r=g","width":96,"height":96,"caption":"A. Pavlenko"}},{"@type":"WebPage","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#webpage","url":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/","name":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0447\u0430\u0442 | Otus","description":"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0443\u0440\u043e\u0432\u043d\u0438 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u0441\u044b\u0440\u043e\u0439 Socket, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 com.sun.net.httpserver.HttpServer \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u0447\u0430\u0442\u0430.","inLanguage":"ru-RU","isPartOf":{"@id":"https:\/\/otus.ru\/journal\/#website"},"breadcrumb":{"@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#breadcrumblist"},"author":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"creator":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2021\/11\/oj-1080x720-5.png","@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#mainImage","width":1080,"height":720},"primaryImageOfPage":{"@id":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/#mainImage"},"datePublished":"2026-09-19T05:56:34+00:00","dateModified":"2026-09-25T15:42:58+00:00"},{"@type":"WebSite","@id":"https:\/\/otus.ru\/journal\/#website","url":"https:\/\/otus.ru\/journal\/","name":"OTUS \u0416\u0443\u0440\u043d\u0430\u043b - \u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","alternateName":"OTUS \u0416\u0443\u0440\u043d\u0430\u043b","description":"\u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","inLanguage":"ru-RU","publisher":{"@id":"https:\/\/otus.ru\/journal\/#organization"}}]}},"aioseo_meta_data":{"post_id":"2407","title":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0447\u0430\u0442 | Otus","description":"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u0443\u0440\u043e\u0432\u043d\u0438 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Java: \u0441\u044b\u0440\u043e\u0439 Socket, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 com.sun.net.httpserver.HttpServer \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u0447\u0430\u0442\u0430.","keywords":[],"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"none","schema_type_options":"{\"webPage\":{\"webPageType\":\"WebPage\"},\"article\":{\"articleType\":\"BlogPosting\"},\"book\":[],\"course\":[],\"event\":[],\"jobPosting\":[],\"music\":[],\"person\":[],\"product\":[],\"recipe\":[],\"restaurant\":[],\"service\":[],\"software\":[],\"video\":[]}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":{"businessInfo":{"name":"","urls":{"website":"","aboutPage":"","contactPage":""},"address":{"line1":"","line2":"","zip":"","city":"","state":"","country":""},"contact":{"email":"","phone":"","fax":""},"ids":{"vatID":"","taxID":"","chamberID":""},"payment":{"priceIndication":"","currenciesAccepted":"","methodsAccepted":""},"areaServed":""},"openingHours":{"show":false,"closedLabel":"","open24h":false,"open24hLabel":"","open247":false,"use24hFormat":false,"twoSets":false,"timezone":"","hours":[]}},"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-11-30 12:36:33","updated":"2026-09-25 16:35:44","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/otus.ru\/journal\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/otus.ru\/journal\/category\/polza\/\" title=\"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435\">\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043d\u0430 HttpServer\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/otus.ru\/journal\/"},{"label":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435","link":"https:\/\/otus.ru\/journal\/category\/polza\/"},{"label":"HTTP-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Java: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0447\u0430\u0442 \u043d\u0430 HttpServer","link":"https:\/\/otus.ru\/journal\/http-server-na-java-izuchenie-servernyh-osnov-na-primere-sozdaniya-sobstvennogo-chata\/"}],"_links":{"self":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/2407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/comments?post=2407"}],"version-history":[{"count":3,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/2407\/revisions"}],"predecessor-version":[{"id":13238,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/2407\/revisions\/13238"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/media\/2408"}],"wp:attachment":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/media?parent=2407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/categories?post=2407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/tags?post=2407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}