{"id":309408,"date":"2020-09-03T15:00:55","date_gmt":"2020-09-03T15:00:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=309408"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-09-03T15:00:55","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=309408","title":{"rendered":"\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 C# .Net framework"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/517670\/\">\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u043c\u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441. \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0442\u0430\u0442\u044c \u0447\u0435\u043c \u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0438\u043d\u0434\u0435\u0440\u0430, \u043d\u043e \u0434\u043b\u044f IT \u0442\u0443\u0441\u043e\u0432\u043a\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043e\u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0448\u044c\u0441\u044f, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0448\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0448\u044c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0443\u0442\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0441\u0432\u043e\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<blockquote><p>\u0417\u0434\u0435\u0441\u044c \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u0431\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0448\u0430\u0433\u0438 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044f \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0410\u0440\u0442\u0438\u0441\u0442\u0430 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0442\u0443\u0434\u0438\u0438, \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 C# \u0441\u0442\u0440\u043e\u0438\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438 \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043b\u044f Unity \u0438 \u0432 \u0434\u043e\u0432\u0435\u0441\u043e\u043a \u043a \u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u0434\u0435\u0432\u0430\u0439\u0441\u0430\u043c\u0438. \u0417\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u044d\u0442\u043e\u0433\u043e \u043c\u0438\u0440\u043a\u0430 \u044f \u0435\u0449\u0451 \u043d\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0438 \u0442\u0443\u0442 \u043f\u043e\u0434\u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c.  <\/p><\/blockquote>\n<h3>\u0427\u0430\u0441\u0442\u044c 1. \u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u043c\u044b<\/h3>\n<p>  \u0420\u0435\u0448\u0438\u0432, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u044f \u043f\u0440\u0438\u043d\u044f\u043b\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u043a\u0430\u043a \u0441\u043e\u0432\u0443 \u043d\u0430 \u0433\u043b\u043e\u0431\u0443\u0441, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0442\u044f\u043d\u0443\u0442\u044c \u043d\u0430\u0448\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438 \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u043d\u0430 \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0440\u0438\u0446\u0430\u043d\u0438\u0435. <br \/>  \u041d\u043e \u044d\u0442\u043e \u0436\u0435 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0447\u0435\u043b\u0435\u043d\u0434\u0436\u0430 \u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u044d\u0442\u043e\u043c \u044f \u043d\u0435 \u0432\u0438\u0434\u0435\u043b, \u0430 \u043f\u043e\u0441\u0435\u043c\u0443 \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u0435\u0431 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043d\u0438\u043c\u0438. <\/p>\n<p>  \u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0430\u043b \u0441 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e C# .Net. \u0422\u0443\u0442 \u044f \u043d\u0430\u0448\u0451\u043b \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438. \u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0441\u0435\u0442\u044c\u044e, \u043e\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432\u0440\u043e\u0434\u0435 ASP.Net \u0438\u043b\u0438 \u0441\u043b\u0443\u0436\u0431 Azure, \u0434\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 Tcp\\Http \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0441 ASP \u044f \u0435\u0433\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u0442\u043c\u0451\u043b, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0442\u044f\u0436\u0451\u043b\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0442\u0440\u0435\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0438. \u0412\u044b\u0431\u043e\u0440 \u0432\u0441\u0442\u0430\u043b \u043c\u0435\u0436\u0434\u0443 TCP \u0438 Http \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0417\u0434\u0435\u0441\u044c \u0436\u0435, \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e <a href=\"https:\/\/habr.com\/ru\/post\/120157\/\">\u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440<\/a>, \u0441\u043e\u0431\u0440\u0430\u0432 \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 TCP \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u043e \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e http \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043d\u0435 \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0430 \u0432 \u0441\u0435\u0431\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u043e\u0442\u0434\u0430\u0432\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u043b\u0430 \u0432 \u0441\u0435\u0431\u044f \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0418 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0430\u0439\u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0441\u044e\u0434\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0438 ios.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0417\u0434\u0435\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a, \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cs\">using System; using System.Net.Sockets; using System.Net; using System.Threading;  namespace ClearServer {      class Server     {         TcpListener Listener;         public Server(int Port)         {             Listener = new TcpListener(IPAddress.Any, Port);             Listener.Start();              while (true)             {                 TcpClient Client = Listener.AcceptTcpClient();                 Thread Thread = new Thread(new ParameterizedThreadStart(ClientThread));                 Thread.Start(Client);             }         }          static void ClientThread(Object StateInfo)         {             new Client((TcpClient)StateInfo);         }          ~Server()         {             if (Listener != null)             {                 Listener.Stop();             }         }          static void Main(string[] args)         {             DatabaseWorker sqlBase = DatabaseWorker.GetInstance;              new Server(80);         }     } }<\/code><\/pre>\n<p>  \u0421\u0430\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432:<\/p>\n<pre><code class=\"cs\">using System; using System.IO; using System.Net.Sockets; using System.Text; using System.Text.RegularExpressions;  namespace ClearServer {     class Client     {           public Client(TcpClient Client)         {              string Message = &quot;&quot;;             byte[] Buffer = new byte[1024];             int Count;             while ((Count = Client.GetStream().Read(Buffer, 0, Buffer.Length)) &gt; 0)             {                 Message += Encoding.UTF8.GetString(Buffer, 0, Count);                  if (Message.IndexOf(&quot;\\r\\n\\r\\n&quot;) &gt;= 0 || Message.Length &gt; 4096)                 {                     Console.WriteLine(Message);                     break;                 }             }              Match ReqMatch = Regex.Match(Message, @&quot;^\\w+\\s+([^\\s\\?]+)[^\\s]*\\s+HTTP\/.*|&quot;);             if (ReqMatch == Match.Empty)             {                 ErrorWorker.SendError(Client, 400);                 return;             }             string RequestUri = ReqMatch.Groups[1].Value;             RequestUri = Uri.UnescapeDataString(RequestUri);             if (RequestUri.IndexOf(&quot;..&quot;) &gt;= 0)             {                 ErrorWorker.SendError(Client, 400);                 return;             }             if (RequestUri.EndsWith(&quot;\/&quot;))             {                 RequestUri += &quot;index.html&quot;;             }              string FilePath = $&quot;D:\/Web\/TestSite{RequestUri}&quot;;              if (!File.Exists(FilePath))             {                 ErrorWorker.SendError(Client, 404);                 return;             }              string Extension = RequestUri.Substring(RequestUri.LastIndexOf('.'));              string ContentType = &quot;&quot;;              switch (Extension)             {                 case &quot;.htm&quot;:                 case &quot;.html&quot;:                     ContentType = &quot;text\/html&quot;;                     break;                 case &quot;.css&quot;:                     ContentType = &quot;text\/css&quot;;                     break;                 case &quot;.js&quot;:                     ContentType = &quot;text\/javascript&quot;;                     break;                 case &quot;.jpg&quot;:                     ContentType = &quot;image\/jpeg&quot;;                     break;                 case &quot;.jpeg&quot;:                 case &quot;.png&quot;:                 case &quot;.gif&quot;:                     ContentType = $&quot;image\/{Extension.Substring(1)}&quot;;                     break;                 default:                     if (Extension.Length &gt; 1)                     {                         ContentType = $&quot;application\/{Extension.Substring(1)}&quot;;                     }                     else                     {                         ContentType = &quot;application\/unknown&quot;;                     }                     break;             }              FileStream FS;             try             {                 FS = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);             }             catch (Exception)             {                 ErrorWorker.SendError(Client, 500);                 return;             }              string Headers = $&quot;HTTP\/1.1 200 OK\\nContent-Type: {ContentType}\\nContent-Length: {FS.Length}\\n\\n&quot;;             byte[] HeadersBuffer = Encoding.ASCII.GetBytes(Headers);             Client.GetStream().Write(HeadersBuffer, 0, HeadersBuffer.Length);              while (FS.Position &lt; FS.Length)             {                 Count = FS.Read(Buffer, 0, Buffer.Length);                 Client.GetStream().Write(Buffer, 0, Count);             }              FS.Close();             Client.Close();         }     } }<\/code><\/pre>\n<p>  \u0418 \u043f\u0435\u0440\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043d\u0430 local SQL:<\/p>\n<pre><code class=\"cs\">using System; using System.Data.Linq; namespace ClearServer {     class DatabaseWorker     {          private static DatabaseWorker instance;          public static DatabaseWorker GetInstance         {             get             {                 if (instance == null)                     instance = new DatabaseWorker();                 return instance;             }         }           private DatabaseWorker()         {             string connectionStr = databasePath;             using (DataContext db = new DataContext(connectionStr))             {                 Table&lt;User&gt; users = db.GetTable&lt;User&gt;();                 foreach (var item in users)                 {                     Console.WriteLine($&quot;{item.login} {item.password}&quot;);                 }             }         }     } }<\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u044d\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u043c\u0430\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0439, \u0447\u0442\u043e \u0431\u044b\u043b\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u041f\u043e \u0441\u0443\u0442\u0438 \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0438 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0441\u0442\u0430\u0442\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430, \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f).  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h3>\u0413\u043b\u0430\u0432\u0430 2. \u041f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043b\u0451\u0441<\/h3>\n<p>  \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u044f \u043f\u0440\u0438\u0448\u0451\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c(<i>\u0441\u043f\u043e\u0439\u043b\u0435\u0440: \u043d\u0435\u0442<\/i>), \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0447\u0430\u043b \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u043e\u0439.<br \/>  \u0428\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043b\u0441\u044f. \u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u0434\u043e\u043c\u0435\u043d\u043e\u043c \u0438 ssl \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0415\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u041e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0439 \u0432 \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430.<\/p>\n<pre><code class=\"cs\">using System; using System.Net; using System.Net.Sockets; using System.Reflection; using System.Security; using System.Security.Cryptography.X509Certificates; using System.Security.Permissions; using System.Security.Policy; using System.Threading;   namespace ClearServer {      sealed class Server     {         readonly bool ServerRunning = true;         readonly TcpListener sslListner;         public static X509Certificate serverCertificate = null;         Server()         {             serverCertificate = X509Certificate.CreateFromSignedFile(@&quot;C:\\ssl\\itinder.online.crt&quot;);             sslListner = new TcpListener(IPAddress.Any, 443);             sslListner.Start();             Console.WriteLine(&quot;Starting server..&quot; + serverCertificate.Subject + &quot;\\n&quot; + Assembly.GetExecutingAssembly().Location);             while (ServerRunning)             {                 TcpClient SslClient = sslListner.AcceptTcpClient();                 Thread SslThread = new Thread(new ParameterizedThreadStart(ClientThread));                 SslThread.Start(SslClient);             }                      }         static void ClientThread(Object StateInfo)         {             new Client((TcpClient)StateInfo);         }          ~Server()         {             if (sslListner != null)             {                 sslListner.Stop();             }         }          public static void Main(string[] args)         {             if (AppDomain.CurrentDomain.IsDefaultAppDomain())             {                 Console.WriteLine(&quot;Switching another domain&quot;);                 new AppDomainSetup                 {                     ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase                 };                 var current = AppDomain.CurrentDomain;                 var strongNames = new StrongName[0];                 var domain = AppDomain.CreateDomain(                     &quot;ClearServer&quot;, null,                     current.SetupInformation, new PermissionSet(PermissionState.Unrestricted),                     strongNames);                 domain.ExecuteAssembly(Assembly.GetExecutingAssembly().Location);             }             new Server();         }     } }<\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e ssl:<\/p>\n<pre><code class=\"cs\">using ClearServer.Core.Requester; using System; using System.Net.Security; using System.Net.Sockets;  namespace ClearServer {     public class Client     {         public Client(TcpClient Client)         {             SslStream SSlClientStream = new SslStream(Client.GetStream(), false);             try             {                 SSlClientStream.AuthenticateAsServer(Server.serverCertificate, clientCertificateRequired: false, checkCertificateRevocation: true);             }             catch (Exception e)             {                 Console.WriteLine(                     &quot;---------------------------------------------------------------------\\n&quot; +                     $&quot;|{DateTime.Now:g}\\n|------------\\n|{Client.Client.RemoteEndPoint}\\n|------------\\n|Exception: {e.Message}\\n|------------\\n|Authentication failed - closing the connection.\\n&quot; +                     &quot;---------------------------------------------------------------------\\n&quot;);                 SSlClientStream.Close();                 Client.Close();             }             new RequestContext(SSlClientStream, Client);         }      } } <\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<p>  \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 TCP \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0433 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u042f \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043f\u0430\u0440\u0441\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0441\u043c\u043e\u0433\u0443 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u044b \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0443\u0436\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0430\u0440\u0441\u0435\u0440<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using ClearServer.Core.UserController; using ReServer.Core.Classes; using System; using System.Collections.Generic; using System.Linq; using System.Net.Security; using System.Net.Sockets; using System.Text; using System.Text.RegularExpressions;  namespace ClearServer.Core.Requester {     public class RequestContext     {         public string Message = &quot;&quot;;         private readonly byte[] buffer = new byte[1024];         public string RequestMethod;         public string RequestUrl;         public User RequestProfile;         public User CurrentUser = null;         public List&lt;RequestValues&gt; HeadersValues;         public List&lt;RequestValues&gt; FormValues;         private TcpClient TcpClient;          private event Action&lt;SslStream, RequestContext&gt; OnRead = RequestHandler.OnHandle;          DatabaseWorker databaseWorker = new DatabaseWorker();          public RequestContext(SslStream ClientStream, TcpClient Client)         {              this.TcpClient = Client;             try             {                 ClientStream.BeginRead(buffer, 0, buffer.Length, ClientRead, ClientStream);             }             catch { return; }         }         private void ClientRead(IAsyncResult ar)         {             SslStream ClientStream = (SslStream)ar.AsyncState;              if (ar.IsCompleted)             {                 Message = Encoding.UTF8.GetString(buffer);                 Message = Uri.UnescapeDataString(Message);                 Console.WriteLine($&quot;\\n{DateTime.Now:g} Client IP:{TcpClient.Client.RemoteEndPoint}\\n{Message}&quot;);                 RequestParse();                 HeadersValues = HeaderValues();                 FormValues = ContentValues();                 UserParse();                 ProfileParse();                 OnRead?.Invoke(ClientStream, this);             }         }          private void RequestParse()         {             Match methodParse = Regex.Match(Message, @&quot;(^\\w+)\\s+([^\\s\\?]+)[^\\s]*\\s+HTTP\/.*|&quot;);             RequestMethod = methodParse.Groups[1].Value.Trim();             RequestUrl = methodParse.Groups[2].Value.Trim();         }         private void UserParse()         {             string cookie;             try             {                 if (HeadersValues.Any(x =&gt; x.Name.Contains(&quot;Cookie&quot;)))                 {                     cookie = HeadersValues.FirstOrDefault(x =&gt; x.Name.Contains(&quot;Cookie&quot;)).Value;                     try                     {                         CurrentUser = databaseWorker.CookieValidate(cookie);                     }                     catch { }                 }             }             catch { }          }         private List&lt;RequestValues&gt; HeaderValues()         {             var values = new List&lt;RequestValues&gt;();             var parse = Regex.Matches(Message, @&quot;(.*?): (.*?)\\n&quot;);             foreach (Match match in parse)             {                 values.Add(new RequestValues()                 {                     Name = match.Groups[1].Value.Trim(),                     Value = match.Groups[2].Value.Trim()                 });             }             return values;         }          private void ProfileParse()         {             if (RequestUrl.Contains(&quot;@&quot;))             {                 RequestProfile = databaseWorker.FindUser(RequestUrl.Substring(2));                 RequestUrl = &quot;\/profile&quot;;             }         }         private List&lt;RequestValues&gt; ContentValues()         {             var values = new List&lt;RequestValues&gt;();             var output = Message.Trim('\\n').Split().Last();             var parse = Regex.Matches(output, @&quot;([^&].*?)=([^&]*\\b)&quot;);             foreach (Match match in parse)             {                 values.Add(new RequestValues()                 {                     Name = match.Groups[1].Value.Trim(),                     Value = match.Groups[2].Value.Trim().Replace('+', ' ')                 });             }             return values;         }     } }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0421\u0443\u0442\u044c \u0435\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0438 url \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0417\u0430\u0442\u0435\u043c \u0447\u0438\u0442\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0433\u043e\u043d\u044f\u0435\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0438\u0434\u0430 \u0418\u043c\u044f\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430=\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u0435\u0441\u043b\u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f, \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 querystring) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u0433\u043e\u043d\u044f\u0435\u043c \u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043f\u0430\u0440\u0441\u0435\u0440 \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0435. \u0412\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0445\u044d\u0448 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043a\u0443\u043a\u0430\u0445, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. <\/p>\n<p>  \u041d\u0443 \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0444\u0438\u0447\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0438\u0434\u0430 \u00absite.com\/@UserName\u00bb \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0434\u0435\u043b\u043e \u0432\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<h3>\u0413\u043b\u0430\u0432\u0430 3. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0443\u043b\u044f, \u0441\u043c\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0446\u0435\u043f\u0438<\/h3>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0441\u0435\u0440 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432 \u0434\u0435\u043b\u043e \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u043e\u0442\u0434\u0430\u044e\u0449\u0438\u0439 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using ClearServer.Core.UserController; using System.Net.Security; namespace ClearServer.Core.Requester {     public class RequestHandler     {         public static void OnHandle(SslStream ClientStream, RequestContext context)         {              if (context.CurrentUser != null)             {                 new AuthUserController(ClientStream, context);             }             else              {                 new NonAuthUserController(ClientStream, context);             };         }     } }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438 \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u044e\u0437\u0435\u0440\u0430, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u043b\u0438 \u044e\u0437\u0435\u0440 \u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d, \u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u043a\u043d\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438\\\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u043e\u0434 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0435\u0433\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using ClearServer.Core.Requester; using System.IO; using System.Net.Security;  namespace ClearServer.Core.UserController {     internal class NonAuthUserController     {         private readonly SslStream ClientStream;         private readonly RequestContext Context;         private readonly WriteController WriteController;         private readonly AuthorizationController AuthorizationController;          private readonly string ViewPath = &quot;C:\/Users\/drdre\/source\/repos\/ClearServer\/View&quot;;          public NonAuthUserController(SslStream clientStream, RequestContext context)         {             this.ClientStream = clientStream;             this.Context = context;             this.WriteController = new WriteController(clientStream);             this.AuthorizationController = new AuthorizationController(clientStream, context);             ResourceLoad();         }          void ResourceLoad()         {             string[] blockextension = new string[] {&quot;cshtml&quot;, &quot;html&quot;, &quot;htm&quot;};             bool block = false;             foreach (var item in blockextension)             {                 if (Context.RequestUrl.Contains(item))                 {                     block = true;                     break;                 }             }             string FilePath = &quot;&quot;;             string Header = &quot;&quot;;             var RazorController = new RazorController(Context, ClientStream);                          switch (Context.RequestMethod)             {                 case &quot;GET&quot;:                     switch (Context.RequestUrl)                     {                         case &quot;\/&quot;:                             FilePath = ViewPath + &quot;\/loginForm.html&quot;;                             Header = $&quot;HTTP\/1.1 200 OK\\nContent-Type: text\/html&quot;;                             WriteController.DefaultWriter(Header, FilePath);                             break;                         case &quot;\/profile&quot;:                             RazorController.ProfileLoader(ViewPath);                             break;                         default: \/\/\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u043e \u043f\u0440\u044f\u043c\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u0438\u0434\u0430 site.com\/page.html                             if (!File.Exists(ViewPath + Context.RequestUrl) | block)                             {                                 RazorController.ErrorLoader(404);                                                             }                                                         else if (Path.HasExtension(Context.RequestUrl) && File.Exists(ViewPath + Context.RequestUrl))                             {                                 Header = WriteController.ContentType(Context.RequestUrl);                                 FilePath = ViewPath + Context.RequestUrl;                                 WriteController.DefaultWriter(Header, FilePath);                             }                                                         break;                     }                     break;                  case &quot;POST&quot;:                     AuthorizationController.MethodRecognizer();                     break;              }          }      } } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435 \u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">WriterController<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.IO; using System.Net.Security; using System.Text;  namespace ClearServer.Core.UserController {     public class WriteController     {         SslStream ClientStream;         public WriteController(SslStream ClientStream)         {             this.ClientStream = ClientStream;         }          public void DefaultWriter(string Header, string FilePath)         {             FileStream fileStream;             try             {                 fileStream = new FileStream(FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);                 Header = $&quot;{Header}\\nContent-Length: {fileStream.Length}\\n\\n&quot;;                 ClientStream.Write(Encoding.UTF8.GetBytes(Header));                 byte[] response = new byte[fileStream.Length];                 fileStream.BeginRead(response, 0, response.Length, OnFileRead, response);             }             catch { }         }          public string ContentType(string Uri)         {             string extension = Path.GetExtension(Uri);             string Header = &quot;HTTP\/1.1 200 OK\\nContent-Type:&quot;;             switch (extension)             {                 case &quot;.html&quot;:                 case &quot;.htm&quot;:                     return $&quot;{Header} text\/html&quot;;                 case &quot;.css&quot;:                     return $&quot;{Header} text\/css&quot;;                 case &quot;.js&quot;:                     return $&quot;{Header} text\/javascript&quot;;                 case &quot;.jpg&quot;:                 case &quot;.jpeg&quot;:                 case &quot;.png&quot;:                 case &quot;.gif&quot;:                     return $&quot;{Header} image\/{extension}&quot;;                 default:                     if (extension.Length &gt; 1)                     {                         return $&quot;{Header} application\/&quot; + extension.Substring(1);                     }                     else                     {                         return $&quot;{Header} application\/unknown&quot;;                     }             }         }          public void OnFileRead(IAsyncResult ar)         {             if (ar.IsCompleted)             {                 var file = (byte[])ar.AsyncState;                 ClientStream.BeginWrite(file, 0, file.Length, OnClientSend, null);             }         }          public void OnClientSend(IAsyncResult ar)         {             if (ar.IsCompleted)             {                 ClientStream.Close();             }         }     }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041d\u043e \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0435\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c RazorEngine, \u0432\u0435\u0440\u043d\u0435\u0435 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c. \u041e\u043d \u0442\u0430\u043a \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">RazorController<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using ClearServer.Core.Requester; using RazorEngine; using RazorEngine.Templating; using System; using System.IO; using System.Net; using System.Net.Security;  namespace ClearServer.Core.UserController {     internal class RazorController     {         private RequestContext Context;         private SslStream ClientStream;         dynamic PageContent;           public RazorController(RequestContext context, SslStream clientStream)         {             this.Context = context;             this.ClientStream = clientStream;          }          public void ProfileLoader(string ViewPath)         {             string Filepath = ViewPath + &quot;\/profile.cshtml&quot;;             if (Context.RequestProfile != null)             {                 if (Context.CurrentUser != null && Context.RequestProfile.login == Context.CurrentUser.login)                 {                     try                     {                         PageContent = new { isAuth = true, Name = Context.CurrentUser.name, Login = Context.CurrentUser.login, Skills = Context.CurrentUser.skills };                         ClientSend(Filepath, Context.CurrentUser.login);                     }                     catch (Exception e) { Console.WriteLine(e); }                  }                 else                 {                     try                     {                         PageContent = new { isAuth = false, Name = Context.RequestProfile.name, Login = Context.RequestProfile.login, Skills = Context.RequestProfile.skills };                         ClientSend(Filepath, &quot;PublicProfile:&quot;+ Context.RequestProfile.login);                     }                     catch (Exception e) { Console.WriteLine(e); }                 }             }             else             {                 ErrorLoader(404);             }           }          public void ErrorLoader(int Code)         {             try             {                 PageContent = new { ErrorCode = Code, Message = ((HttpStatusCode)Code).ToString() };                 string ErrorPage = &quot;C:\/Users\/drdre\/source\/repos\/ClearServer\/View\/Errors\/ErrorPage.cshtml&quot;;                 ClientSend(ErrorPage, Code.ToString());             }             catch { }          }          private void ClientSend(string FilePath, string Key)         {             var template = File.ReadAllText(FilePath);             var result = Engine.Razor.RunCompile(template, Key, null, (object)PageContent);             byte[] buffer = System.Text.Encoding.UTF8.GetBytes(result);             ClientStream.BeginWrite(buffer, 0, buffer.Length, OnClientSend, ClientStream);         }          private void OnClientSend(IAsyncResult ar)         {             if (ar.IsCompleted)             {                 ClientStream.Close();             }         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0443\u0436\u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u041c\u043e\u0434\u0443\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0444\u043e\u0440\u043c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0430\u0440\u0441\u044f\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u044e\u0437\u0435\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u0437\u0430\u043c\u0435\u043d \u043a\u0443\u043a\u0438 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041c\u043e\u0434\u0443\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using ClearServer.Core.Cookies; using ClearServer.Core.Requester; using ClearServer.Core.Security; using System; using System.Linq; using System.Net.Security; using System.Text;  namespace ClearServer.Core.UserController {     internal class AuthorizationController     {         private SslStream ClientStream;         private RequestContext Context;         private UserCookies cookies;         private WriteController WriteController;         DatabaseWorker DatabaseWorker;         RazorController RazorController;         PasswordHasher PasswordHasher;         public AuthorizationController(SslStream clientStream, RequestContext context)         {             ClientStream = clientStream;             Context = context;             DatabaseWorker = new DatabaseWorker();             WriteController = new WriteController(ClientStream);             RazorController = new RazorController(context, clientStream);             PasswordHasher = new PasswordHasher();         }          internal void MethodRecognizer()         {             if (Context.FormValues.Count == 2 && Context.FormValues.Any(x =&gt; x.Name == &quot;password&quot;)) Authorize();             else if (Context.FormValues.Count == 3 && Context.FormValues.Any(x =&gt; x.Name == &quot;regPass&quot;)) Registration();             else             {                 RazorController.ErrorLoader(401);             }         }          private void Authorize()         {             var values = Context.FormValues;             var user = new User()             {                 login = values[0].Value,                 password = PasswordHasher.PasswordHash(values[1].Value)             };             user = DatabaseWorker.UserAuth(user);             if (user != null)             {                 cookies = new UserCookies(user.login, user.password);                 user.cookie = cookies.AuthCookie;                 DatabaseWorker.UserUpdate(user);                 var response = Encoding.UTF8.GetBytes($&quot;HTTP\/1.1 301 Moved Permanently\\nLocation: \/@{user.login}\\nSet-Cookie: {cookies.AuthCookie}; Expires={DateTime.Now.AddDays(2):R}; Secure; HttpOnly\\n\\n&quot;);                 ClientStream.BeginWrite(response, 0, response.Length, WriteController.OnClientSend, null);               }             else             {                 RazorController.ErrorLoader(401);              }         }          private void Registration()         {             var values = Context.FormValues;             var user = new User()             {                 name = values[0].Value,                 login = values[1].Value,                 password = PasswordHasher.PasswordHash(values[2].Value),             };             cookies = new UserCookies(user.login, user.password);             user.cookie = cookies.AuthCookie;             if (DatabaseWorker.LoginValidate(user.login))             {                 Console.WriteLine(&quot;User ready&quot;);                 Console.WriteLine($&quot;{user.password} {user.password.Trim().Length}&quot;);                 DatabaseWorker.UserRegister(user);                 var response = Encoding.UTF8.GetBytes($&quot;HTTP\/1.1 301 Moved Permanently\\nLocation: \/@{user.login}\\nSet-Cookie: {user.cookie}; Expires={DateTime.Now.AddDays(2):R}; Secure; HttpOnly\\n\\n&quot;);                 ClientStream.BeginWrite(response, 0, response.Length, WriteController.OnClientSend, null);             }             else             {                 RazorController.ErrorLoader(401);             }         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0410 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using ClearServer.Core.UserController; using System; using System.Data.Linq; using System.Linq;  namespace ClearServer {     class DatabaseWorker     {          private readonly Table&lt;User&gt; users = null;         private readonly DataContext DataBase = null;         private const string connectionStr = @&quot;\u043f\u0443\u0442\u044c\u043a\u0431\u0430\u0437\u0435&quot;;          public DatabaseWorker()         {             DataBase = new DataContext(connectionStr);             users = DataBase.GetTable&lt;User&gt;();         }          public User UserAuth(User User)         {             try             {                 var user = users.SingleOrDefault(t =&gt; t.login.ToLower() == User.login.ToLower() && t.password == User.password);                 if (user != null)                     return user;                 else                     return null;             }             catch (Exception)             {                 return null;             }          }          public void UserRegister(User user)         {             try             {                 users.InsertOnSubmit(user);                 DataBase.SubmitChanges();                 Console.WriteLine($&quot;User{user.name} with id {user.uid} added&quot;);                 foreach (var item in users)                 {                     Console.WriteLine(item.login + &quot;\\n&quot;);                 }             }             catch (Exception e)             {                 Console.WriteLine(e);             }                      }          public bool LoginValidate(string login)         {             if (users.Any(x =&gt; x.login.ToLower() == login.ToLower()))             {                 Console.WriteLine(&quot;Login already exists&quot;);                 return false;             }             return true;         }         public void UserUpdate(User user)         {             var UserToUpdate = users.FirstOrDefault(x =&gt; x.uid == user.uid);             UserToUpdate = user;             DataBase.SubmitChanges();             Console.WriteLine($&quot;User {UserToUpdate.name} with id {UserToUpdate.uid} updated&quot;);             foreach (var item in users)             {                 Console.WriteLine(item.login + &quot;\\n&quot;);             }         }         public User CookieValidate(string CookieInput)         {             User user = null;             try             {                 user = users.SingleOrDefault(x =&gt; x.cookie == CookieInput);             }             catch             {                 return null;             }             if (user != null) return user;             else return null;         }         public User FindUser(string login)         {             User user = null;             try             {                 user = users.Single(x =&gt; x.login.ToLower() == login.ToLower());                 if (user != null)                 {                     return user;                 }                 else                 {                     return null;                 }             }             catch (Exception)             {                 return null;             }         }     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0418 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0447\u0430\u0441\u044b, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0443\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u0448\u043b\u0430 \u043f\u043e\u0440\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u0431\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u0440\u0430\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u0441\u0451 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h3>\u0413\u043b\u0430\u0432\u0430 4. \u0412\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0430<\/h3>\n<p>  \u0427\u0442\u043e \u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 \u0434\u0432\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043d\u0430 Xamarin.Forms. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430 C#. \u0421\u0434\u0435\u043b\u0430\u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0435, \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c. \u0414\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u044f \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u043d\u0430 HttpClient \u0438 \u043a\u0438\u043d\u0443\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 HttpRequestMessage \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0444\u043e\u0440\u043c\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json. \u041e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u044f, \u043e\u0442\u043a\u0440\u044b\u043b \u043b\u043e\u0433 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0443\u0432\u0438\u0434\u0435\u043b \u0442\u0430\u043c \u0440\u0435\u043a\u0432\u0435\u0441\u0442 \u0441 \u0434\u0435\u0432\u0430\u0439\u0441\u0430 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041b\u0451\u0433\u043a\u0438\u0439 \u0441\u0442\u0443\u043f\u043e\u0440, \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043e \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 3 \u043d\u0435\u0434\u0435\u043b\u0438 \u0442\u043e\u043c\u043d\u044b\u0445 \u0432\u0435\u0447\u0435\u0440\u043e\u043c. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u0440\u0430\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 HttpListner. \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0436\u0435 \u043d\u0430 \u043d\u0451\u043c, \u044f \u0437\u0430 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b \u0435\u0433\u043e \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u043b KeyValuePair \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u043e\u0440\u043c\u044b. \u0420\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u0441\u044f \u0434\u043e \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u043a. <\/p>\n<p>  \u041d\u0430\u0447\u0430\u043b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435, \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u043d\u0430 \u043f\u0440\u0435\u0436\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044f \u0435\u0449\u0451 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b \u0447\u0430\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0432\u0435\u0431\u0441\u043e\u043a\u0435\u0442\u0430\u0445. \u041e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u043e \u0441\u0430\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Tcp \u0431\u044b\u043b \u0443\u0434\u0440\u0443\u0447\u0430\u044e\u0449\u0438\u043c, \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u043b\u043e\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u0431\u044b \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0434\u0432\u0443\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043b\u043e\u0433\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u043a\u0438. \u042d\u0442\u043e \u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u0431\u043e\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 RFC 6455. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0435\u0431\u0441\u043e\u043a\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0427\u0438\u0441\u0442\u043e \u0440\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0447\u0430\u0442\u0443<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\"> private static async void HandleWebsocket(HttpListenerContext context)         {             var socketContext = await context.AcceptWebSocketAsync(null);             var socket = socketContext.WebSocket;             Locker.EnterWriteLock();             try             {                 Clients.Add(socket);             }             finally             {                 Locker.ExitWriteLock();             }              while (true)             {                 var buffer = new ArraySegment&lt;byte&gt;(new byte[1024]);                 var result = await socket.ReceiveAsync(buffer, CancellationToken.None);                 var str = Encoding.Default.GetString(buffer);                 Console.WriteLine(str);                  for (int i = 0; i &lt; Clients.Count; i++)                 {                     WebSocket client = Clients[i];                      try                     {                         if (client.State == WebSocketState.Open)                         {                                                          await client.SendAsync(buffer, WebSocketMessageType.Text, true, CancellationToken.None);                         }                     }                     catch (ObjectDisposedException)                     {                         Locker.EnterWriteLock();                         try                         {                             Clients.Remove(client);                             i--;                         }                         finally                         {                             Locker.ExitWriteLock();                         }                     }                 }             }         } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0418 \u043e\u043d\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0421\u0435\u0440\u0432\u0435\u0440 \u0441\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447. \u041c\u043d\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e ssl, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u0442\u0443.<\/p>\n<p>  \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0434\u0435\u0432\u0430\u0439\u0441\u0430 \u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0430\u0439\u0442\u0430 \u0434\u0432\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438, \u0432\u0441\u0451 \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0445 \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u0432, \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0438\u0447\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c. \u0412\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0441 200\u043c\u0441 \u0434\u043e 40-30\u043c\u0441. \u0418 \u044f \u043f\u0440\u0438\u0448\u0451\u043b \u043a \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044e.  <\/p>\n<blockquote><p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/x4\/k9\/bj\/x4k9bjywh59bnmt8ncxar8s19jo.gif\"\/><\/p><\/blockquote>\n<p>  \u0412\u044b\u043a\u0438\u043d\u0443\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Tcp \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u043f\u043e\u0434 Http. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0443\u0436\u0435 \u043f\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0420\u0430\u0431\u043e\u0442\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u0441\u0430\u0439\u0442\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u043e\u0442\u043b\u0430\u0436\u0435\u043d\u0430 \u0438 \u0438\u043c\u0435\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e, \u0441 \u0442\u0435\u043c \u043b\u0438\u0448\u044c \u043e\u0442\u043b\u0438\u0447\u0438\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0434\u0435\u0432\u0430\u0439\u0441\u043e\u0432 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c html \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. <\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434<\/h3>\n<p>  <i>\u00ab\u041d\u0435 \u0437\u043d\u0430\u044f \u0431\u0440\u043e\u0434\u0443, \u043d\u0435 \u0441\u0443\u0439\u0441\u044f \u0432 \u0432\u043e\u0434\u0443\u00bb<\/i> \u0434\u0443\u043c\u0430\u044e, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0430\u0431\u043e\u0442, \u043c\u043d\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0446\u0435\u043b\u0438 \u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445. \u041f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u0431\u043b\u0438\u0437\u0438\u0442\u044c\u0441\u044f \u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e, \u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u0435\u0449\u0451 \u0432\u0435\u0440\u043d\u0443\u0441\u044c, \u0447\u0442\u043e \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0444\u0430\u043a\u0430\u043f\u0438\u043b \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0432\u0435\u0449\u0438. \u042f \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043d\u043e \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0442\u043e \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u044d\u0442\u043e.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/517670\/\"> https:\/\/habr.com\/ru\/post\/517670\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/517670\/\">\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u043c\u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441. \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0442\u0430\u0442\u044c \u0447\u0435\u043c \u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u0438\u043d\u0434\u0435\u0440\u0430, \u043d\u043e \u0434\u043b\u044f IT \u0442\u0443\u0441\u043e\u0432\u043a\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043e\u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0448\u044c\u0441\u044f, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0448\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0448\u044c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0443\u0442\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0438\u0441\u043a\u0443 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043d\u0438\u043a\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0441\u0432\u043e\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-309408","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309408"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309408\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}