{"id":485182,"date":"2026-06-26T13:45:10","date_gmt":"2026-06-26T13:45:10","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=485182"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=485182","title":{"rendered":"WebSocket \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u0430"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9a\/768\/85f\/a9a76885f10ae9a0c860a0db0e4a2fb5.jpg\" width=\"1280\" height=\"720\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a9a\/768\/85f\/a9a76885f10ae9a0c860a0db0e4a2fb5.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9a\/768\/85f\/a9a76885f10ae9a0c860a0db0e4a2fb5.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440 \u0411\u0443\u0440\u043c\u0438\u0441\u0442\u0440\u043e\u0432, \u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0445\u043e\u043b\u0434\u0438\u043d\u0433\u0430 \u04221. \u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u00a0WebSocket \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u0430: \u043e\u0442\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 HTTP 101\u00a0\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0434\u043e\u00a0\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u00a0API Gateway, sticky\u2011sessions \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430\u00a0\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435 \u0438\u0437\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0433\u0434\u0435 \u0436\u0438\u0432\u0443\u0442 \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u00ab\u0437\u043e\u043e\u043f\u0430\u0440\u043a\u0435\u00bb:<\/p>\n<ul>\n<li>\n<p>REST\u2011API;<\/p>\n<\/li>\n<li>\n<p>WebSocket;<\/p>\n<\/li>\n<li>\n<p>GraphQL;<\/p>\n<\/li>\n<li>\n<p>gRPC;<\/p>\n<\/li>\n<li>\n<p>Kafka;<\/p>\n<\/li>\n<li>\n<p>Redis (\u043a\u0435\u0448 \u0438 pub\/sub);<\/p>\n<\/li>\n<li>\n<p>WebRTC \u0434\u043b\u044f\u00a0\u0432\u0438\u0434\u0435\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u00a0\u0442\u0430\u043a\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043e\u0447\u0435\u043d\u044c\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e: WebSocket\u00a0\u2014 \u043d\u0435\u00a0\u043c\u043e\u0434\u043d\u0430\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0430, \u0430\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0443\u0437\u043a\u043e\u0433\u043e, \u043d\u043e\u00a0\u0432\u0430\u0436\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<h2>\u0417\u0430\u0447\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u00a0WebSocket?<\/h2>\n<p>\u0412\u043e\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0436\u0438\u0432\u0451\u0442 \u0432\u00a0\u0443\u044e\u0442\u043d\u043e\u043c \u043c\u0438\u0440\u0435 REST: \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b, CRUD, contract\u2011first \u0438 \u043f\u0440\u043e\u0447\u0438\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440. API \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 WebSocket \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0447\u0435\u043c\u2011\u0442\u043e \u00ab\u0434\u043b\u044f \u0444\u0438\u043d\u0442\u0435\u0445\u0430, \u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433\u0430 \u0438 \u0438\u0433\u0440\u00bb.<\/p>\n<p>\u041d\u043e\u00a0\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0445\u043e\u0442\u044f\u00a0\u0431\u044b \u043e\u0434\u043d\u043e\u0439 \u0438\u0437\u00a0\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447:<\/p>\n<ul>\n<li>\n<p>\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0447\u0430\u0442\u044b \u0441 \u00ab\u0436\u0438\u0432\u044b\u043c\u0438\u00bb \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430 \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0431\u0435\u0437\u00a0\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (Confluence, Google Docs);<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0435 \u0434\u043e\u0441\u043a\u0438 (Miro\u2011\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435);<\/p>\n<\/li>\n<li>\n<p>realtime\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u044b;<\/p>\n<\/li>\n<li>\n<p>\u043e\u043d\u043b\u0430\u0439\u043d\u2011\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0438, \u0433\u0434\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>&#8230;\u043a\u0430\u043a REST \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u044f\u043d\u0443\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0432\u043d\u0438\u0437: polling, long\u2011polling, \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u0447\u0430\u0441\u0442\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>WebSocket \u043a\u0430\u043a\u00a0\u0440\u0430\u0437 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u0434\u0430\u0447, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u0432\u0430\u0436\u043d\u0430 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u0441\u0432\u044f\u0437\u044c (client \u2194 server);<\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u0436\u043d\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 overhead \u043e\u0442\u00a0\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 HTTP\u2011\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u043c\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u00a0WebSocket \u0436\u0438\u0432\u0451\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 HTTP \u0438 TCP<\/h2>\n<h3>Upgrade: \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441\u00a0HTTP \u043d\u0430\u00a0WebSocket<\/h3>\n<p>WebSocket \u043d\u0435\u00a0\u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u00ab\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u00bb \u0441\u0430\u043c \u043f\u043e\u00a0\u0441\u0435\u0431\u0435\u00a0\u2014 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u00a0\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e HTTP\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u043e\u0441\u0438\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 HTTP\u2011handshake.<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430:<\/p>\n<pre><code>GET \/ws\/chat HTTP\/1.1Host: example.comConnection: UpgradeUpgrade: websocketSec\u2011WebSocket\u2011Version: 13Sec\u2011WebSocket\u2011Key: dGhlIHNhbXBsZSBub25jZQ==<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code>HTTP\/1.1 101\u00a0Switching ProtocolsUpgrade: websocketConnection: UpgradeSec\u2011WebSocket\u2011Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u043e\u0434 HTTP\u00a0<strong>101\u00a0Switching Protocols<\/strong>\u00a0\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u043b\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441\u00a0HTTP \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0432\u00a0\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u00a0\u2014 WebSocket.<\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430: WebSocket\u2011\u043a\u0430\u043d\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e HTTP\u2011\u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0430, \u0438 \u0434\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0443\u00a0\u0432\u0430\u0441 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u00a0\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0432\u0441\u0435\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u043e\u043a\u0441\u0438 \u0438 \u0448\u043b\u044e\u0437\u043e\u0432.<\/p>\n<h3>ws:\/\/ \u0438 wss:\/\/: \u0441\u0445\u0435\u043c\u044b URI<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u00a0\u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<ul>\n<li>\n<p><code>ws:\/\/example.com\/ws\/chat<\/code>\u00a0\u2014 \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 WebSocket;<\/p>\n<\/li>\n<li>\n<p><code>wss:\/\/example.com\/ws\/chat<\/code>\u00a0\u2014 WebSocket \u043f\u043e\u0432\u0435\u0440\u0445 TLS (\u0430\u043d\u0430\u043b\u043e\u0433 HTTPS).<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u00a0\u0441\u0445\u0435\u043c\u0430\u0445 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0432\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u0442\u0435, \u0433\u0434\u0435 REST (https:\/\/), \u0430\u00a0\u0433\u0434\u0435 realtime\u2011\u043a\u0430\u043d\u0430\u043b (wss:\/\/);<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f\u00a0\u0418\u0411 \u0438 DevOps \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u00a0\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 WebSocket: \u0444\u0440\u0435\u0439\u043c\u044b, payload \u0438 \u0434\u0435\u043b\u044c\u0442\u044b<\/h2>\n<h3>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0440\u0435\u0439\u043c\u0430<\/h3>\n<p>WebSocket \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u00a0\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0430\u00a0\u0444\u0440\u0435\u0439\u043c\u0430\u043c\u0438. \u0423\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><code>FIN\u00a0<\/code>\u2014 \u0444\u043b\u0430\u0433, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439\u00a0\u043b\u0438 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p><code>OPCODE<\/code>\u00a0\u2014 \u0442\u0438\u043f \u0444\u0440\u0435\u0439\u043c\u0430 (\u0442\u0435\u043a\u0441\u0442, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439, ping, pong, close);<\/p>\n<\/li>\n<li>\n<p><code>MASK<\/code>\u00a0+\u00a0<code>MASKING-KEY<\/code>\u00a0\u2014 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u043b\u0438\u0435\u043d\u0442 \u2192 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d);<\/p>\n<\/li>\n<li>\n<p><code>PAYLOAD-LENGTH<\/code>\u00a0\u2014 \u0434\u043b\u0438\u043d\u0430 \u0442\u0435\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p><code>PAYLOAD<\/code>\u00a0\u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 (\u0442\u0435\u043a\u0441\u0442, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f\u00a0\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0432\u0430\u0436\u043d\u044b \u0432\u044b\u0432\u043e\u0434\u044b:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u043e \u043d\u0430\u00a0\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0440\u0435\u0439\u043c\u043e\u0432 (\u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432);<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u044b\u00a0<code>ping<\/code>\/<code>pong<\/code>\u00a0\u0434\u043b\u044f\u00a0heartbeat\u2019\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0432\u00a0\u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u00a0\u0443\u0440\u043e\u0432\u043d\u0435 \u00ab\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00bb (message), \u0430\u00a0\u043d\u0435\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u00a0\u0444\u0440\u0435\u0439\u043c\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0431\u0430\u0433\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e payload (\u0447\u0430\u0442)<\/h3>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u00ab\u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u00a0\u0447\u0430\u0442\u0435\u00bb \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">{  \"type\": \"chat.message.new\",  \"chatId\": \"c_12345\",  \"messageId\": \"m_67890\",  \"senderId\": \"u_100500\",  \"createdAt\": \"2026-02-09T13:45:12.123Z\",  \"text\": \"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!\",  \"attachments\": [    {      \"id\": \"att_1\",      \"type\": \"image\",      \"url\": \"https:\/\/cdn.example.com\/att_1.png\"    }  ]}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0434\u043b\u044f\u00a0\u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><code>type<\/code>\u00a0\u2014 \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e WebSocket\u2011\u043a\u0430\u043d\u0430\u043b\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (<code>chatId<\/code>,\u00a0<code>messageId<\/code>,\u00a0<code>senderId<\/code>);<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u044f \u0434\u043b\u044f\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u0435\u043b\u044c\u0442\u0430\u2011payload (whiteboard)<\/h3>\n<p>\u0414\u043b\u044f\u00a0\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0434\u043e\u0441\u043a\u0438 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0435\u0441\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.<\/p>\n<pre><code class=\"javascript\">{  \"type\": \"board.elements.updated\",  \"boardId\": \"b_42\",  \"version\": 157,  \"authorId\": \"u_100500\",  \"changes\": [    {      \"elementId\": \"el_10\",      \"op\": \"move\",      \"from\": { \"x\": 100, \"y\": 200 },      \"to\":   { \"x\": 130, \"y\": 210 }    },    {      \"elementId\": \"el_11\",      \"op\": \"text.update\",      \"prev\": \"Hello\",      \"next\": \"Hello, world\"    }  ],  \"timestamp\": \"2026-02-09T13:45:12.123Z\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 (<code>version<\/code>) \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (<code>changes<\/code>), \u0430\u00a0\u043d\u0435\u00a0\u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e\u0441\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (<code>op<\/code>) \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0438 \u043c\u043e\u0433\u0443\u0442\u00a0\u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h2>Heartbeat, \u043c\u0451\u0440\u0442\u0432\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 SLA \u043d\u0430\u00a0\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443<\/h2>\n<h3>Ping\/pong \u0438 heartbeat \u043d\u0430\u00a0\u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435<\/h3>\n<p>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b WebSocket \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 ping\/pong\u2011\u0444\u0440\u0435\u0439\u043c\u044b, \u043d\u043e\u00a0\u0432\u00a0\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0445 API \u043e\u043d\u0438 \u043d\u0435\u00a0\u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0439 heartbeat\u00a0\u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00a0<code>ping<\/code>\/<code>pong<\/code>\u00a0\u0441\u00a0JSON.<\/p>\n<p>\u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442:<\/p>\n<pre><code class=\"javascript\">\/\/ \u041f\u0438\u043d\u0433 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430{  \"type\": \"ping\",  \"timestamp\": 1760000000000}\/\/ \u041f\u043e\u043d\u0433 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430{  \"type\": \"pong\",  \"timestamp\": 1760000000000,  \"serverTime\": 1760000000100,  \"latency\": 100}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0434\u0443\u0442 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e\u00a0\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p><code>connectedAt<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>lastPingTime<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>lastPongTime<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>latencyHistory<\/code>;<\/p>\n<\/li>\n<li>\n<p><code>missedHeartbeats<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u00a0\u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438\u00a0<code>timeSinceLastPing &gt; HEARTBEAT_INTERVAL * MAX_MISSED_HEARTBEATS<\/code>\u00a0\u2014 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u00a0\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u0447\u0438\u0441\u0442\u044f\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (\u043a\u0430\u0440\u0442\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 subscription\u2019\u044b).<\/p>\n<\/li>\n<\/ul>\n<h3>SLA \u043d\u0430\u00a0\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438: \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445<\/h3>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u043c\u043a\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><strong>\u0447\u0430\u0442\u044b<\/strong>:<\/p>\n<ul>\n<li>\n<p>\u0446\u0435\u043b\u0435\u0432\u043e\u0439 SLA \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00a0\u2014 \u0434\u043e 100\u00a0\u043c\u0441 \u0434\u043b\u044f 95\u2011\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u043b\u044f 99\u2011\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f\u00a0\u2014 \u0434\u043e 500\u00a0\u043c\u0441;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/strong>: \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u043e 5\u00a0\u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439, \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u00ab\u0437\u0430\u043f\u043e\u0437\u0434\u0430\u0432\u0448\u0438\u043c\u00bb;<\/p>\n<\/li>\n<li>\n<p><strong>whiteboard<\/strong>: \u0434\u043b\u044f\u00a0\u043f\u043b\u0430\u0432\u043d\u043e\u0433\u043e UX \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0444\u0438\u0433\u0443\u0440 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435\u00a0\u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 50\u2013100\u00a0\u043c\u0441.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u0432 \u0438 \u043a\u0435\u0448\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043d\u044f\u0442\u044c, \u043d\u0443\u0436\u0435\u043d\u00a0\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 WebSocket\u2011\u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043f\u043e\u0434\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>WebSocket \u0432\u00a0\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435: \u0441\u0445\u0435\u043c\u044b \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/h2>\n<h3>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430: \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441<\/h3>\n<p>\u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 (\u0443\u0440\u043e\u0432\u0435\u043d\u044c C4\u2011Container):<\/p>\n<ul>\n<li>\n<p><strong>Client (Web\/App)<\/strong>\u00a0\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u00a0\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 <code>wss:\/\/ws.example.com\/ws<\/code>;<\/p>\n<\/li>\n<li>\n<p><strong>API Gateway<\/strong>\u00a0\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 WebSocket\u2011handshake, \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u00a0<code>Upgrade<\/code>\/<code>Connection<\/code>\u00a0\u0432\u00a0\u0431\u044d\u043a\u0435\u043d\u0434;<\/p>\n<\/li>\n<li>\n<p><strong>WebSocket Service <\/strong>\u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0447\u0430\u0442\u044b, \u0434\u043e\u0441\u043a\u0438, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f) \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p><strong>Business Services<\/strong>:<\/p>\n<ul>\n<li>\n<p>Chat Service\u00a0\u2014 \u0432\u043b\u0430\u0434\u0435\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0447\u0430\u0442\u043e\u0432 \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>Board Service\u00a0\u2014 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430\u00a0whiteboard;<\/p>\n<\/li>\n<li>\n<p>Notification Service\u00a0\u2014 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439;<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Transport Layer<\/strong>:<\/p>\n<ul>\n<li>\n<p>Kafka\/NATS\/RabbitMQ\u00a0\u2014 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u0430\u044f \u0448\u0438\u043d\u0430;<\/p>\n<\/li>\n<li>\n<p>Redis (pub\/sub, \u043a\u0435\u0448) \u0434\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u044b\u0445 fan\u2011out\u2011\u0440\u0430\u0441\u0441\u044b\u043b\u043e\u043a.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u00a0\u2014 \u044d\u0442\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0443. \u041e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c \u00ab\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u00bb \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u00ab\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0430\u00bb \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 (Kafka\/Redis) \u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<h3>API Gateway \u0438 Upgrade\u2011\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b WebSocket \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0447\u0435\u0440\u0435\u0437 API Gateway (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, nginx), \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u00a0\u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 nginx:<\/p>\n<pre><code class=\"java\">location \/ws\/ {    proxy_pass http:\/\/ws-backend;    proxy_http_version 1.1;    proxy_set_header Upgrade $http_upgrade;    proxy_set_header Connection \"upgrade\";}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0411\u0435\u0437\u00a0\u044d\u0442\u043e\u0433\u043e \u0430\u043f\u0433\u0440\u0435\u0439\u0434 \u043d\u0435\u00a0\u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442: \u0448\u043b\u044e\u0437 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043d\u0435\u00a0\u0441\u043e\u0437\u0434\u0430\u0441\u0442 WebSocket\u2011\u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0432\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u00ab101\u00a0Switching Protocols\u00bb \u0438\u043b\u0438\u00a0\u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h3>Sticky\u2011sessions \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 WebSocket<\/h3>\n<p>\u041f\u0440\u0438\u00a0\u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p>\u0443\u00a0\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0430\u00a0\u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e WebSocket\u2011\u0441\u0435\u0441\u0441\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u0447\u0430\u0442\u0435, \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u044e:<\/p>\n<ol>\n<li>\n<p><strong>Sticky\u2011sessions \u043d\u0430\u00a0\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435. <\/strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u00a0cookie, IP \u0438\u043b\u0438\u00a0\u0445\u0435\u0448\u0443\u00a0<code>userId<\/code>\u00a0\u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u00a0\u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442\u00a0\u0436\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (\u0434\u043e \u0441\u043c\u0435\u043d\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438). \u042d\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0445\u0430\u043e\u0441, \u043d\u043e\u00a0\u043d\u0435\u00a0\u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 fan\u2011out \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 pub\/sub (Redis, Kafka). <\/strong>\u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0435 \u0432\u00a0Chat Service, \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043f\u0438\u043a \u0432\u0438\u0434\u0430\u00a0<code>chat.{chatId}<\/code>\u00a0\u0432\u00a0Kafka \u0438\u043b\u0438\u00a0Redis pub\/sub. \u0412\u0441\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0438\u0441\u044f\u0442 \u0443\u00a0\u043d\u0438\u0445 \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u0441\u0435\u0441\u0441\u0438\u0439. <\/strong>\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432\u0438\u0434\u0430\u00a0<code>userId -&gt; [connectionId, instanceId...]<\/code>\u00a0\u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c, \u0433\u0434\u0435 \u0441\u0438\u0434\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0435\u0433\u043e \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u0440\u0438\u00a0logout;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f: \u00ab\u043d\u0435 \u0431\u043e\u043b\u0435\u0435 N \u0441\u0435\u0441\u0441\u0438\u0439 \u043d\u0430\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00bb.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u0437\u0430\u00a0\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 HTTP\u2011\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a\u00a0\u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443 (\u0447\u0430\u0441\u0442\u043e 6). \u0414\u043b\u044f\u00a0WebSocket\u00a0\u043b\u0438\u043c\u0438\u0442\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u00ab\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438\u00bb \u043e\u043d\u0438 \u043d\u0435\u00a0\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e WebSocket\u2011\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a\u00a0\u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0432\u00a0\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b (<code>ws1.example.com<\/code>,\u00a0<code>ws2.example.com<\/code>), \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u00a0\u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0447\u0430\u0449\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u0434\u0438\u043d WebSocket\u2011\u043a\u0430\u043d\u0430\u043b \u043f\u043e\u0434\u00a0\u0447\u0430\u0442\u044b \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 WebSocket\u2011\u043a\u0430\u043d\u0430\u043b \u043f\u043e\u0434\u00a0\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 realtime\u2011\u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u00a0\u0442\u0438\u043f\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (<code>type<\/code>\u00a0\u0432\u00a0payload\u2019\u0435).<\/p>\n<h2>WebSocket, SSE \u0438 long\u2011polling: \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e\u00a0\u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0441\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043d\u0430\u00a0\u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u00ab\u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u0439\u00bb \u043f\u043e\u00a0realtime\u2011\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\"> <strong>\u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"> <strong>WebSocket<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"> <strong>SSE (Server\u2011Sent Events)<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"> <strong>Long\u2011polling<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0414\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (\u043a\u043b\u0438\u0435\u043d\u0442 \u2194 \u0441\u0435\u0440\u0432\u0435\u0440).<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (\u0441\u0435\u0440\u0432\u0435\u0440 \u2192 \u043a\u043b\u0438\u0435\u043d\u0442).<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043b\u0438\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u0440\u0438\u00a0\u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u043e\u0432\u0435\u0440\u0445 TCP, \u0441\u0442\u0430\u0440\u0442 \u0447\u0435\u0440\u0435\u0437 HTTP Upgrade.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0438\u0441\u0442\u044b\u0439 HTTP (\u043f\u043e\u0442\u043e\u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439).<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0438\u0441\u0442\u044b\u0439 HTTP (\u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 + \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0432\u0442\u043e\u0440)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u0435\u043a\u0441\u0442 \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u044b.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0441\u0442 (UTF\u20118), \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e JSON.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u00a0HTTP\u2011\u043e\u0442\u0432\u0435\u0442\u0435 (\u043e\u0431\u044b\u0447\u043d\u043e JSON).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0430\u044f (\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u0442\u043b\u0430\u0434\u043a\u0430).<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u044f\u044f, \u043f\u0440\u043e\u0449\u0435 WebSocket.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u00ab\u043f\u0440\u043e\u0441\u0442\u043e HTTP\u00bb.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b, \u043a\u0440\u043e\u043c\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0430\u0440\u044b\u0445 IE.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0412\u0435\u0437\u0434\u0435, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c HTTP.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 (\u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438).<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0415\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u00a0EventSource\u00a0+ \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0446\u0438\u043a\u043b\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438 \u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Upgrade, \u0438\u043d\u043e\u0433\u0434\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041b\u0435\u0433\u0447\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP\u2011\u043f\u043e\u0442\u043e\u043a.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e (\u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0430\u0442\u044b, \u0438\u0433\u0440\u044b, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041b\u0435\u043d\u0442\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043a \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432 \u0438 \u043c\u0435\u0442\u0440\u0438\u043a.<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u043d\u0435\u00a0\u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0445\u0441\u044f realtime, \u043a\u043e\u0433\u0434\u0430 WebSocket\/SSE \u043d\u0435\u00a0\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041a\u0430\u043a\u00a0\u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u0430\u00a0\u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439<\/h3>\n<ol>\n<li>\n<p><strong>\u041d\u0443\u0436\u043d\u0430 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u0441\u0432\u044f\u0437\u044c \u0438 \u0447\u0430\u0441\u0442\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0447\u0430\u0442\u044b, \u0434\u043e\u0441\u043a\u0438, \u0438\u0433\u0440\u044b, \u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433). <\/strong>\u0412\u044b\u0431\u043e\u0440 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 WebSocket.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u00a0\u043a\u043b\u0438\u0435\u043d\u0442 (\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u043b\u0435\u043d\u0442\u044b, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433) \u0441\u00a0\u0443\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439. <\/strong>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c SSE:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0441\u0442\u043e\u0439 API\u00a0EventSource\u00a0\u0432\u00a0\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP, \u043f\u0440\u043e\u0449\u0435 \u0418\u0411 \u0438 \u0441\u0435\u0442\u0435\u0432\u0438\u043a\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u00a0<code>open<\/code>, <code>error<\/code>, <code>message<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u041e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0440\u0435\u0436\u0435\u0442 WebSocket \u0438 SSE, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e HTTP\/1. <\/strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c long\u2011poll\u2019\u0438\u043d\u0433:<\/p>\n<ul>\n<li>\n<p>\u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u00a0\u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438\u00a0\u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u044c\u0448\u0435 overhead\u2019\u0430 \u043f\u043e\u00a0\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c, \u0445\u0443\u0436\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u0432\u0435\u0437\u0434\u0435\u00bb.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p> <strong>\u0413\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. <\/strong>\u041d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>WebSocket \u0434\u043b\u044f\u00a0\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0438\u0447 (\u0447\u0430\u0442\u044b, \u0434\u043e\u0441\u043a\u0438, \u043a\u0443\u0440\u0441\u043e\u0440\u044b);<\/p>\n<\/li>\n<li>\n<p>SSE \u0438 long\u2011polling \u0434\u043b\u044f \u00ab\u043c\u044f\u0433\u043a\u0438\u0445\u00bb \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0435\u043d\u0442.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447<\/h2>\n<p>\u041d\u0438\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0442\u0440\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430: \u0434\u043b\u044f\u00a0whiteboard, \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043d\u0430\u0431\u043e\u0440\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439.<\/p>\n<h3>Whiteboard (\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f \u0434\u043e\u0441\u043a\u0430)<\/h3>\n<h4>\u0421\u043e\u0431\u044b\u0442\u0438\u0435: \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043e\u0441\u043a\u0438<\/h4>\n<ul>\n<li>\n<p><strong>\u0421\u043e\u0431\u044b\u0442\u0438\u0435:<\/strong>\u00a0<code>board.elements.updated<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442:<\/strong>\u00a0WebSocket (<code>wss:\/\/ws.example.com\/ws<\/code>).<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440:<\/strong>\u00a0\u043a\u043b\u0438\u0435\u043d\u0442 (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u0443 \u0438\u043b\u0438\u00a0\u043f\u0440\u0430\u0432\u0438\u0442 \u0442\u0435\u043a\u0441\u0442), \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f\u00a0Board Service.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0438:<\/strong>\u00a0\u0432\u0441\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u0434\u043e\u0441\u043a\u0438\u00a0<code>boardId<\/code>, \u043a\u0440\u043e\u043c\u0435 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e) \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<p> <strong>\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u2192 WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441 \u2192 Board Service (\u0447\u0435\u0440\u0435\u0437 Kafka\/REST\/GRPC);<\/p>\n<\/li>\n<li>\n<p>Board Service \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442, \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435\u00a0<code>board.elements.updated<\/code>;<\/p>\n<\/li>\n<li>\n<p>WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432\u0441\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0430\u043c \u0434\u043e\u0441\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>JSON\u2011\u0441\u0445\u0435\u043c\u0430 payload<\/h4>\n<pre><code class=\"javascript\">{  \"type\": \"board.elements.updated\",  \"boardId\": \"string\",  \"version\": \"integer\",  \"authorId\": \"string\",  \"changes\": [    {      \"elementId\": \"string\",      \"op\": \"create|update|delete|move|resize\",      \"prev\": { \"nullable\": true },      \"next\": { \"nullable\": true }    }  ],  \"timestamp\": \"string (ISO-8601)\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p> <strong>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p><code>version<\/code>\u00a0\u2014 \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043e\u0441\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p> <code>rev<\/code> \u0438 <code>next<\/code>\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u0440\u0430\u0437\u043c\u0435\u0440\u044b, \u0442\u0435\u043a\u0441\u0442);<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0440\u00a0<code>changes<\/code>\u00a0\u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438\u00a0\u2014 \u043d\u0435\u00a0\u0431\u043e\u043b\u0435\u0435 100\u00a0\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0431\u0430\u0442\u0447\u0438\u0442\u0441\u044f).<\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 SLA<\/h4>\n<ul>\n<li>\n<p>\u041f\u0438\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430\u00a0\u043e\u0434\u043d\u043e\u0439 \u0434\u043e\u0441\u043a\u0435: \u0434\u043e 50.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u00a0<code>board.elements.updated<\/code>\u00a0\u043d\u0430\u00a0\u0434\u043e\u0441\u043a\u0443: \u0434\u043e 200\/\u0441\u0435\u043a.<\/p>\n<\/li>\n<li>\n<p>SLA \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u00a0Board Service \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439 \u0432\u00a0WebSocket\u2011\u043a\u043b\u0438\u0435\u043d\u0442:<\/p>\n<ul>\n<li>\n<p>95\u2011\u0439 \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044c\u00a0\u2014 \u0434\u043e 100\u00a0\u043c\u0441;<\/p>\n<\/li>\n<li>\n<p>99\u2011\u0439 \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044c\u00a0\u2014 \u0434\u043e 250\u00a0\u043c\u0441.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c<\/h4>\n<ul>\n<li>\n<p>\u041f\u043e\u0442\u0435\u0440\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043e\u0431\u044f\u0437\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e\u0441\u043a\u0438: <code>GET \/boards\/{boardId}\/state?version={clientVersion}<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u00a0\u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 Board Service \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0435\u043b\u044c\u0442\u044b \u0438\u043b\u0438\u00a0\u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/h4>\n<ul>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a\u00a0<code>boardId<\/code>\u00a0(ACL).<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u043d\u0430\u00a0\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043e\u0441\u043a\u0438 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"javascript\">{  \"type\": \"board.subscribe\",  \"boardId\": \"b_42\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0430\u0431\u043e\u0440\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 (\u00abuser is typing\u2026\u00bb)<\/h3>\n<p>\u042d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u00a0\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u00a0\u0411\u0414 \u0438 \u0447\u0438\u0441\u0442\u043e realtime.<\/p>\n<h4>\u0421\u043e\u0431\u044b\u0442\u0438\u0435: \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u0430<\/h4>\n<ul>\n<li>\n<p> <strong>\u0421\u043e\u0431\u044b\u0442\u0438\u0435:<\/strong>\u00a0<code>chat.typing<\/code>.<\/p>\n<\/li>\n<li>\n<p> <strong>\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442:<\/strong>\u00a0WebSocket (\u043e\u0431\u0449\u0438\u0439 \u043a\u0430\u043d\u0430\u043b \u0447\u0430\u0442\u043e\u0432).<\/p>\n<\/li>\n<li>\n<p> <strong>\u0418\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440:<\/strong>\u00a0\u043a\u043b\u0438\u0435\u043d\u0442 (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u043b\u0438\u00a0\u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440).<\/p>\n<\/li>\n<li>\n<p> <strong>\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0438:<\/strong>\u00a0\u0432\u0441\u0435 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0438 \u0447\u0430\u0442\u0430\u00a0<code>chatId<\/code>, \u043a\u0440\u043e\u043c\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<h4>JSON\u2011\u0441\u0445\u0435\u043c\u0430 payload<\/h4>\n<pre><code class=\"javascript\">{  \"type\": \"chat.typing\",  \"chatId\": \"string\",  \"userId\": \"string\",  \"state\": \"started|stopped\",  \"timestamp\": \"string (ISO-8601)\"}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p> <strong>\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u00a0\u043a\u043b\u0438\u0435\u043d\u0442\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p><code>state = started<\/code>\u00a0\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u00a0\u0447\u0430\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430 \u0432\u00a0\u0434\u0432\u0435 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u0440\u0438\u00a0\u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435;<\/p>\n<\/li>\n<li>\n<p><code>state = stopped<\/code>\u00a0\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u00a0\u043f\u043e\u0442\u0435\u0440\u0435 \u0444\u043e\u043a\u0443\u0441\u0430 \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0438\u043b\u0438\u00a0\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0432\u0432\u043e\u0434\u0430 \u0434\u043e\u043b\u044c\u0448\u0435 N \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 SLA<\/h4>\n<ul>\n<li>\n<p>\u041f\u0438\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043d\u0430\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u043c \u0447\u0430\u0442\u0435: \u0434\u043e 20.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0\u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438: \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 10\u00a0\u0441\u043e\u0431\u044b\u0442\u0438\u0439\/\u0441\u0435\u043a \u043d\u0430\u00a0\u0447\u0430\u0442 \u043f\u043e\u00a0<code>chat.typing<\/code>.<\/p>\n<\/li>\n<li>\n<p>SLA: \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435\u00a0\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430, \u043d\u043e\u00a0\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e 500\u00a0\u043c\u0441 \u0434\u043b\u044f\u00a0\u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e\u0433\u043e UX.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c<\/h4>\n<ul>\n<li>\n<p>\u041f\u043e\u0442\u0435\u0440\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u00a0<code>chat.typing<\/code>\u00a0\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430, \u043e\u043d\u0438 \u043d\u0435\u00a0\u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430\u00a0\u0431\u0438\u0437\u043d\u0435\u0441\u2011\u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/h4>\n<ul>\n<li>\n<p>\u0422\u0435\u00a0\u0436\u0435 \u043f\u0440\u0430\u0432\u0430, \u0447\u0442\u043e\u00a0\u0438 \u043d\u0430\u00a0<code>chat.message.*<\/code>: \u0432\u0438\u0434\u0435\u0442\u044c typing event \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u00a0\u0447\u0430\u0442\u0435, \u0433\u0434\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f: WebSocket, SSE \u0438 long\u2011polling<\/h3>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e\u00a0\u0443\u00a0\u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0431\u0449\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">{  \"id\": \"string\",  \"userId\": \"string\",  \"type\": \"task.assigned|comment.added|system.alert|...\",  \"title\": \"string\",  \"body\": \"string\",  \"createdAt\": \"string (ISO-8601)\",  \"read\": \"boolean\",  \"data\": {    \"...\": \"...\"  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>WebSocket\u2011\u0441\u043e\u0431\u044b\u0442\u0438\u0435 notification.new<\/h4>\n<p> <strong>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0432 \u00ab\u0442\u043e\u043b\u0441\u0442\u043e\u043c\u00bb \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0441\u00a0WebSocket;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u0436\u043d\u044b \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u0432\u00a0\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 (\u0431\u0435\u0439\u0434\u0436\u0438, \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u0448\u043a\u0438).<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0421\u043e\u0431\u044b\u0442\u0438\u0435:<\/strong>\u00a0<code>notification.new<\/code><\/p>\n<pre><code class=\"javascript\">{  \"type\": \"notification.new\",  \"notification\": {    \"id\": \"n_123\",    \"userId\": \"u_42\",    \"type\": \"task.assigned\",    \"title\": \"\u041d\u043e\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430\",    \"body\": \"\u0412\u0430\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 #12345\",    \"createdAt\": \"2026-02-09T13:45:12.123Z\",    \"read\": false,    \"data\": {      \"taskId\": \"12345\"    }  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 SLA:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0434\u043e 5\u202f000\u00a0\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439\/\u0441\u0435\u043a \u043f\u043e\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u0435;<\/p>\n<\/li>\n<li>\n<p>SLA \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438: \u0434\u043e 2\u00a0\u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u043e\u00a0WebSocket \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e, \u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0438\u00a0\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0434\u0435\u043b\u0430\u0442\u044c REST\u2011\u0437\u0430\u043f\u0440\u043e\u0441: <code>GET \/notifications?since=lastSeenId<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h4>SSE\u2011\u043a\u0430\u043d\u0430\u043b GET \/sse\/notifications<\/h4>\n<p><strong>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a \u0441\u0435\u0440\u0432\u0435\u0440 \u2192 \u043a\u043b\u0438\u0435\u043d\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435\u00a0\u0434\u0435\u0440\u0436\u0438\u0442 WebSocket \u043f\u043e\u00a0\u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c;<\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u00ab\u043c\u044f\u0433\u043a\u043e\u0435\u00bb \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f\u00a0\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u043b\u0438\u0435\u043d\u0442 (\u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434):<\/strong><\/p>\n<pre><code class=\"javascript\">const evtSource = new EventSource(\"\/sse\/notifications\");evtSource.onmessage = (event) =&gt; {  const payload = JSON.parse(event.data);  \/\/ payload = notification.new, \u043a\u0430\u043a \u0432 WebSocket-\u043f\u0440\u0438\u043c\u0435\u0440\u0435};evtSource.onerror = (err) =&gt; {  \/\/ \u043b\u043e\u0433, UI-\u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 fallback \u043d\u0430 long-polling};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 (SSE):<\/strong><\/p>\n<pre><code class=\"javascript\">event: notification.newdata: {\"id\":\"n_123\",\"userId\":\"u_42\",\"type\":\"task.assigned\", ...}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u00a0<code>Last-Event-ID<\/code>\u00a0\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f\u00a0\u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<h4>Long\u2011polling GET \/notifications\/stream<\/h4>\n<p><strong>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0432\u00a0\u0441\u0442\u0430\u0440\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445;<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0433\u0434\u0430 WebSocket \u0438 SSE \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e;<\/p>\n<\/li>\n<li>\n<p>\u0432\u00a0\u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 (\u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439).<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b:<\/strong><\/p>\n<ol>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u00a0<code>GET \/notifications\/stream?since=lastSeenId<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u00a0\u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438\u043b\u0438\u00a0\u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 30\u00a0\u0441\u0435\u043a\u0443\u043d\u0434).<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 (\u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c).<\/p>\n<\/li>\n<li>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<\/li>\n<\/ol>\n<p> <strong>\u0414\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e HTTP;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u0435\u043d \u043a\u00a0\u043f\u0440\u043e\u043a\u0441\u0438 \u0438 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430\u043c.<\/p>\n<\/li>\n<\/ul>\n<p> <strong>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0443\u00a0\u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430\u00a0\u2014 \u043f\u043e\u043b\u043d\u044b\u0439 HTTP overhead (\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435);<\/p>\n<\/li>\n<li>\n<p>\u0445\u0443\u0436\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u00a0\u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0447\u0430\u0441\u0442\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041a\u0430\u043a\u00a0\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u0430\u043c \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0432\u00a0\u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 WebSocket<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b WebSocket \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u00a0\u0431\u044b\u0442\u044c \u00ab\u0447\u0451\u0440\u043d\u043e\u0439 \u043a\u043e\u0440\u043e\u0431\u043a\u043e\u0439\u00bb, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432.<\/p>\n<ol>\n<li>\n<p><strong>\u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 HTTP\u2011handshake:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439\u00a0<code>GET<\/code>\u00a0\u0441\u00a0<code>Upgrade<\/code>\/<code>Connection<\/code>;<\/p>\n<\/li>\n<li>\n<p>\u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u00a0<code>101 Switching Protocols<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u0427\u0435\u0440\u0435\u0437 Postman \u0438 Insomnia \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a\u00a0\u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 WebSocket\u2011\u0441\u0435\u0440\u0432\u0435\u0440\u0443<\/strong>\u00a0(echo\u2011\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u00a0<a href=\"http:\/\/websocket.org\">websocket.org<\/a>).<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430\u00a0WebSocket\u2011\u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/strong>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439:<\/p>\n<ul>\n<li>\n<p>\u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0438\u0446\u0438\u0430\u0442\u043e\u0440\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>JSON\u2011\u0441\u0445\u0435\u043c\u0443;<\/p>\n<\/li>\n<li>\n<p>SLA \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u00a0\u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u041d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c (\u0445\u043e\u0442\u044f\u00a0\u0431\u044b \u0442\u0435\u043a\u0441\u0442\u043e\u043c) C4\u2011\u0441\u0445\u0435\u043c\u0443<\/strong>, \u0433\u0434\u0435:<\/p>\n<ul>\n<li>\n<p>WebSocket \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0432\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441;<\/p>\n<\/li>\n<li>\n<p>\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 API Gateway;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u043e\u043a\u0435\u0440 (Kafka\/Redis) \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 WebSocket\u2011\u0441\u043b\u043e\u0435\u043c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u044b \u043f\u0440\u043e\u00a0realtime\u2011API \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u044e\u0442\u00a0\u0431\u044b\u0442\u044c \u00ab\u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432\u00bb \u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c, \u043f\u0443\u0441\u0442\u044c \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432\u00a0\u043d\u0430\u0431\u043e\u0440\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u0430.<\/p>\n<\/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\/articles\/1052342\/\">https:\/\/habr.com\/ru\/articles\/1052342\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440 \u0411\u0443\u0440\u043c\u0438\u0441\u0442\u0440\u043e\u0432, \u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0445\u043e\u043b\u0434\u0438\u043d\u0433\u0430 \u04221. \u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u00a0WebSocket \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440\u0430: \u043e\u0442\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 HTTP 101\u00a0\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0432 \u0434\u043e\u00a0\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u00a0API Gateway, sticky\u2011sessions \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u0437\u0430\u0434\u0430\u0447.\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430\u00a0\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435 \u0438\u0437\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0433\u0434\u0435 \u0436\u0438\u0432\u0443\u0442 \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u00ab\u0437\u043e\u043e\u043f\u0430\u0440\u043a\u0435\u00bb:REST\u2011API;WebSocket;GraphQL;gRPC;Kafka;Redis (\u043a\u0435\u0448 \u0438 pub\/sub);WebRTC \u0434\u043b\u044f\u00a0\u0432\u0438\u0434\u0435\u043e.\u0421\u00a0\u0442\u0430\u043a\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043e\u0447\u0435\u043d\u044c\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e: WebSocket\u00a0\u2014 \u043d\u0435\u00a0\u043c\u043e\u0434\u043d\u0430\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0430, \u0430\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0443\u0437\u043a\u043e\u0433\u043e, \u043d\u043e\u00a0\u0432\u0430\u0436\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0437\u0430\u0434\u0430\u0447.\u0417\u0430\u0447\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0443\u043c\u0430\u0442\u044c \u043e\u00a0WebSocket?\u0412\u043e\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0436\u0438\u0432\u0451\u0442 \u0432\u00a0\u0443\u044e\u0442\u043d\u043e\u043c \u043c\u0438\u0440\u0435 REST: \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b, CRUD, contract\u2011first \u0438 \u043f\u0440\u043e\u0447\u0438\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440. API \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 WebSocket \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0447\u0435\u043c\u2011\u0442\u043e \u00ab\u0434\u043b\u044f \u0444\u0438\u043d\u0442\u0435\u0445\u0430, \u0442\u0440\u0435\u0439\u0434\u0438\u043d\u0433\u0430 \u0438 \u0438\u0433\u0440\u00bb.\u041d\u043e\u00a0\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0445\u043e\u0442\u044f\u00a0\u0431\u044b \u043e\u0434\u043d\u043e\u0439 \u0438\u0437\u00a0\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447:\u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0447\u0430\u0442\u044b \u0441 \u00ab\u0436\u0438\u0432\u044b\u043c\u0438\u00bb \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430 \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0431\u0435\u0437\u00a0\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438;\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (Confluence, Google Docs);\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0435 \u0434\u043e\u0441\u043a\u0438 (Miro\u2011\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435);realtime\u2011\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u044b;\u043e\u043d\u043b\u0430\u0439\u043d\u2011\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0438, \u0433\u0434\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430&#8230;.\u043a\u0430\u043a REST \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u044f\u043d\u0443\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0432\u043d\u0438\u0437: polling, long\u2011polling, \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u0447\u0430\u0441\u0442\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438.WebSocket \u043a\u0430\u043a\u00a0\u0440\u0430\u0437 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u0434\u0430\u0447, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0445:\u0432\u0430\u0436\u043d\u0430 \u0434\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f \u0441\u0432\u044f\u0437\u044c (client \u2194 server);\u043d\u0443\u0436\u043d\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438;\u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 overhead \u043e\u0442\u00a0\u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 HTTP\u2011\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432;\u043c\u043d\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.\u041a\u0430\u043a\u00a0WebSocket \u0436\u0438\u0432\u0451\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 HTTP \u0438 TCPUpgrade: \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0441\u00a0HTTP \u043d\u0430\u00a0WebSocketWebSocket \u043d\u0435\u00a0\u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u00ab\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u00bb \u0441\u0430\u043c \u043f\u043e\u00a0\u0441\u0435\u0431\u0435\u00a0\u2014 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u00a0\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e HTTP\u2011\u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u043e\u0441\u0438\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b.\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 HTTP\u2011handshake.\u0417\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430:GET \/ws\/chat HTTP\/1.1Host: example.comConnection: UpgradeUpgrade: websocketSec\u2011WebSocket\u2011Version: 13Sec\u2011WebSocket\u2011Key: dGhlIHNhbXBsZSBub25jZQ==\u041e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:HTTP\/1.1 101\u00a0Switching ProtocolsUpgrade: websocketConnection: UpgradeSec\u2011WebSocket\u2011Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\u041a\u043e\u0434 HTTP\u00a0101\u00a0Switching Protocols\u00a0\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e\u00a0\u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u043b\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441\u00a0HTTP \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0432\u00a0\u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u00a0\u2014 WebSocket.\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430: WebSocket\u2011\u043a\u0430\u043d\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e HTTP\u2011\u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0430, \u0438 \u0434\u043e\u00a0\u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0443\u00a0\u0432\u0430\u0441 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u00a0\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0432\u0441\u0435\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u043e\u043a\u0441\u0438 \u0438 \u0448\u043b\u044e\u0437\u043e\u0432.ws:\/\/ \u0438 wss:\/\/: \u0441\u0445\u0435\u043c\u044b URI\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u00a0\u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:ws:\/\/example.com\/ws\/chat\u00a0\u2014 \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 WebSocket;wss:\/\/example.com\/ws\/chat\u00a0\u2014 WebSocket \u043f\u043e\u0432\u0435\u0440\u0445 TLS (\u0430\u043d\u0430\u043b\u043e\u0433 HTTPS).\u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:\u043d\u0430\u00a0\u0441\u0445\u0435\u043c\u0430\u0445 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 \u0432\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u0442\u0435, \u0433\u0434\u0435 REST (https:\/\/), \u0430\u00a0\u0433\u0434\u0435 realtime\u2011\u043a\u0430\u043d\u0430\u043b (wss:\/\/);\u0434\u043b\u044f\u00a0\u0418\u0411 \u0438 DevOps \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0441\u00a0\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438.\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 WebSocket: \u0444\u0440\u0435\u0439\u043c\u044b, payload \u0438 \u0434\u0435\u043b\u044c\u0442\u044b\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0440\u0435\u0439\u043c\u0430WebSocket \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u00a0\u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0430\u00a0\u0444\u0440\u0435\u0439\u043c\u0430\u043c\u0438. \u0423\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u043e:FIN\u00a0\u2014 \u0444\u043b\u0430\u0433, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439\u00a0\u043b\u0438 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f;OPCODE\u00a0\u2014 \u0442\u0438\u043f \u0444\u0440\u0435\u0439\u043c\u0430 (\u0442\u0435\u043a\u0441\u0442, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439, ping, pong, close);MASK\u00a0+\u00a0MASKING-KEY\u00a0\u2014 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u043b\u0438\u0435\u043d\u0442 \u2192 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d);PAYLOAD-LENGTH\u00a0\u2014 \u0434\u043b\u0438\u043d\u0430 \u0442\u0435\u043b\u0430;PAYLOAD\u00a0\u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 (\u0442\u0435\u043a\u0441\u0442, \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435).\u0414\u043b\u044f\u00a0\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0432\u0430\u0436\u043d\u044b \u0432\u044b\u0432\u043e\u0434\u044b:\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u043e \u043d\u0430\u00a0\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0440\u0435\u0439\u043c\u043e\u0432 (\u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432);\u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u044b\u00a0ping\/pong\u00a0\u0434\u043b\u044f\u00a0heartbeat\u2019\u0430;\u0432\u00a0\u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u00a0\u0443\u0440\u043e\u0432\u043d\u0435 \u00ab\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00bb (message), \u0430\u00a0\u043d\u0435\u00a0\u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u00a0\u0444\u0440\u0435\u0439\u043c\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435 \u0431\u0430\u0433\u0438.\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e payload (\u0447\u0430\u0442)\u041e\u0431\u044b\u0447\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u00ab\u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u00a0\u0447\u0430\u0442\u0435\u00bb \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:{  &#171;type&#187;: &#171;chat.message.new&#187;,  &#171;chatId&#187;: &#171;c_12345&#187;,  &#171;messageId&#187;: &#171;m_67890&#187;,  &#171;senderId&#187;: &#171;u_100500&#187;,  &#171;createdAt&#187;: &#171;2026-02-09T13:45:12.123Z&#187;,  &#171;text&#187;: &#171;\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!&#187;,  &#171;attachments&#187;: [    {      &#171;id&#187;: &#171;att_1&#187;,      &#171;type&#187;: &#171;image&#187;,      &#171;url&#187;: &#171;https:\/\/cdn.example.com\/att_1.png&#187;    }  ]}\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0434\u043b\u044f\u00a0\u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438:type\u00a0\u2014 \u0442\u0438\u043f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e WebSocket\u2011\u043a\u0430\u043d\u0430\u043b\u0430;\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 (chatId,\u00a0messageId,\u00a0senderId);\u043f\u043e\u043b\u044f \u0434\u043b\u044f\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u0442\u0430\u0442\u0443\u0441\u044b \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0447\u0435\u0435).\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u0435\u043b\u044c\u0442\u0430\u2011payload (whiteboard)\u0414\u043b\u044f\u00a0\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0439 \u0434\u043e\u0441\u043a\u0438 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0433\u043e\u043d\u044f\u0442\u044c \u0432\u0435\u0441\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.{  &#171;type&#187;: &#171;board.elements.updated&#187;,  &#171;boardId&#187;: &#171;b_42&#187;,  &#171;version&#187;: 157,  &#171;authorId&#187;: &#171;u_100500&#187;,  &#171;changes&#187;: [    {      &#171;elementId&#187;: &#171;el_10&#187;,      &#171;op&#187;: &#171;move&#187;,      &#171;from&#187;: { &#171;x&#187;: 100, &#171;y&#187;: 200 },      &#171;to&#187;:   { &#171;x&#187;: 130, &#171;y&#187;: 210 }    },    {      &#171;elementId&#187;: &#171;el_11&#187;,      &#171;op&#187;: &#171;text.update&#187;,      &#171;prev&#187;: &#171;Hello&#187;,      &#171;next&#187;: &#171;Hello, world&#187;    }  ],  &#171;timestamp&#187;: &#171;2026-02-09T13:45:12.123Z&#187;}\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e:\u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 (version) \u0434\u043b\u044f\u00a0\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432;\u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 (changes), \u0430\u00a0\u043d\u0435\u00a0\u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e\u0441\u043a\u0438;\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (op) \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0438 \u043c\u043e\u0433\u0443\u0442\u00a0\u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c\u0438.Heartbeat, \u043c\u0451\u0440\u0442\u0432\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 SLA \u043d\u0430\u00a0\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443Ping\/pong \u0438 heartbeat \u043d\u0430\u00a0\u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b WebSocket \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 ping\/pong\u2011\u0444\u0440\u0435\u0439\u043c\u044b, \u043d\u043e\u00a0\u0432\u00a0\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0445 API \u043e\u043d\u0438 \u043d\u0435\u00a0\u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0439 heartbeat\u00a0\u2014 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00a0ping\/pong\u00a0\u0441\u00a0JSON.\u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442:\/\/ \u041f\u0438\u043d\u0433 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430{  &#171;type&#187;: &#171;ping&#187;,  &#171;timestamp&#187;: 1760000000000}\/\/ \u041f\u043e\u043d\u0433 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430{  &#171;type&#187;: &#171;pong&#187;,  &#171;timestamp&#187;: 1760000000000,  &#171;serverTime&#187;: 1760000000100,  &#171;latency&#187;: 100}\u041d\u0430\u00a0\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0434\u0443\u0442 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e\u00a0\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c:connectedAt;lastPingTime;lastPongTime;latencyHistory;missedHeartbeats.\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u00a0\u0442\u0430\u0439\u043c\u0435\u0440\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442:\u0435\u0441\u043b\u0438\u00a0timeSinceLastPing &gt; HEARTBEAT_INTERVAL * MAX_MISSED_HEARTBEATS\u00a0\u2014 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c;\u043f\u0440\u0438\u00a0\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u0447\u0438\u0441\u0442\u044f\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (\u043a\u0430\u0440\u0442\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 subscription\u2019\u044b).SLA \u043d\u0430\u00a0\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438: \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u043c\u043a\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u044b:\u0447\u0430\u0442\u044b:\u0446\u0435\u043b\u0435\u0432\u043e\u0439 SLA \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00a0\u2014 \u0434\u043e 100\u00a0\u043c\u0441 \u0434\u043b\u044f 95\u2011\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f;\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u043b\u044f 99\u2011\u0433\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f\u00a0\u2014 \u0434\u043e 500\u00a0\u043c\u0441;\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f: \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u043e 5\u00a0\u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439, \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u00ab\u0437\u0430\u043f\u043e\u0437\u0434\u0430\u0432\u0448\u0438\u043c\u00bb;whiteboard: \u0434\u043b\u044f\u00a0\u043f\u043b\u0430\u0432\u043d\u043e\u0433\u043e UX \u043f\u0440\u0438\u00a0\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0444\u0438\u0433\u0443\u0440 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435\u00a0\u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c 50\u2013100\u00a0\u043c\u0441.\u0422\u0430\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435:\u0437\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0431\u0440\u043e\u043a\u0435\u0440\u043e\u0432 \u0438 \u043a\u0435\u0448\u0435\u0439;\u043f\u043e\u043d\u044f\u0442\u044c, \u043d\u0443\u0436\u0435\u043d\u00a0\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 WebSocket\u2011\u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u043f\u043e\u0434\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c;\u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.WebSocket \u0432\u00a0\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435: \u0441\u0445\u0435\u043c\u044b \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430: \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0422\u0438\u043f\u043e\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 (\u0443\u0440\u043e\u0432\u0435\u043d\u044c C4\u2011Container):Client (Web\/App)\u00a0\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u00a0\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 wss:\/\/ws.example.com\/ws;API Gateway\u00a0\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 WebSocket\u2011handshake, \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u00a0Upgrade\/Connection\u00a0\u0432\u00a0\u0431\u044d\u043a\u0435\u043d\u0434;WebSocket Service \u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u0447\u0430\u0442\u044b, \u0434\u043e\u0441\u043a\u0438, \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f) \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0430\u043c;Business Services:Chat Service\u00a0\u2014 \u0432\u043b\u0430\u0434\u0435\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0447\u0430\u0442\u043e\u0432 \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439;Board Service\u00a0\u2014 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430\u00a0whiteboard;Notification Service\u00a0\u2014 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439;Transport Layer:Kafka\/NATS\/RabbitMQ\u00a0\u2014 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u0430\u044f \u0448\u0438\u043d\u0430;Redis (pub\/sub, \u043a\u0435\u0448) \u0434\u043b\u044f\u00a0\u0431\u044b\u0441\u0442\u0440\u044b\u0445 fan\u2011out\u2011\u0440\u0430\u0441\u0441\u044b\u043b\u043e\u043a.\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u00a0\u2014 \u044d\u0442\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043b\u043e\u0433\u0438\u043a\u0443. \u041e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c \u00ab\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u00bb \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u00ab\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0430\u00bb \u043c\u0435\u0436\u0434\u0443 \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 (Kafka\/Redis) \u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438.API Gateway \u0438 Upgrade\u2011\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438\u0427\u0442\u043e\u0431\u044b WebSocket \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0447\u0435\u0440\u0435\u0437 API Gateway (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, nginx), \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u00a0\u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438.\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 nginx:location \/ws\/ {    proxy_pass http:\/\/ws-backend;    proxy_http_version 1.1;    proxy_set_header Upgrade $http_upgrade;    proxy_set_header Connection &#171;upgrade&#187;;}\u0411\u0435\u0437\u00a0\u044d\u0442\u043e\u0433\u043e \u0430\u043f\u0433\u0440\u0435\u0439\u0434 \u043d\u0435\u00a0\u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442: \u0448\u043b\u044e\u0437 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP\u2011\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043d\u0435\u00a0\u0441\u043e\u0437\u0434\u0430\u0441\u0442 WebSocket\u2011\u0442\u0443\u043d\u043d\u0435\u043b\u044c, \u0432\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043b\u0438\u0435\u043d\u0442 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u00ab101\u00a0Switching Protocols\u00bb \u0438\u043b\u0438\u00a0\u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443.Sticky\u2011sessions \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 WebSocket\u041f\u0440\u0438\u00a0\u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:\u0443\u00a0\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u0430\u00a0\u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e WebSocket\u2011\u0441\u0435\u0441\u0441\u0438\u0439;\u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u00a0\u043e\u0434\u043d\u043e\u043c \u0447\u0430\u0442\u0435, \u043c\u043e\u0433\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445.\u0422\u0438\u043f\u043e\u0432\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043a\u00a0\u0440\u0435\u0448\u0435\u043d\u0438\u044e:Sticky\u2011sessions \u043d\u0430\u00a0\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u00a0cookie, IP \u0438\u043b\u0438\u00a0\u0445\u0435\u0448\u0443\u00a0userId\u00a0\u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u043d\u0430\u00a0\u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442\u00a0\u0436\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 (\u0434\u043e \u0441\u043c\u0435\u043d\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438). \u042d\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0445\u0430\u043e\u0441, \u043d\u043e\u00a0\u043d\u0435\u00a0\u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 fan\u2011out \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438.\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 pub\/sub (Redis, Kafka). \u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u0435 \u0432\u00a0Chat Service, \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043f\u0438\u043a \u0432\u0438\u0434\u0430\u00a0chat.{chatId}\u00a0\u0432\u00a0Kafka \u0438\u043b\u0438\u00a0Redis pub\/sub. \u0412\u0441\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b WebSocket\u2011\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0438\u0441\u044f\u0442 \u0443\u00a0\u043d\u0438\u0445 \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438.\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u0441\u0435\u0441\u0441\u0438\u0439. \u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432\u0438\u0434\u0430\u00a0userId -&gt; [connectionId, instanceId&#8230;]\u00a0\u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442:\u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c, \u0433\u0434\u0435 \u0441\u0438\u0434\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c;\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0435\u0433\u043e \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u0440\u0438\u00a0logout;\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441\u2011\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f: \u00ab\u043d\u0435 \u0431\u043e\u043b\u0435\u0435 N \u0441\u0435\u0441\u0441\u0438\u0439 \u043d\u0430\u00a0\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00bb.\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u0437\u0430\u00a0\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 HTTP\u2011\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043a\u00a0\u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443 (\u0447\u0430\u0441\u0442\u043e 6). \u0414\u043b\u044f\u00a0WebSocket\u00a0\u043b\u0438\u043c\u0438\u0442\u044b \u0434\u0440\u0443\u0433\u0438\u0435 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u00ab\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438\u00bb \u043e\u043d\u0438 \u043d\u0435\u00a0\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435:\u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e WebSocket\u2011\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a\u00a0\u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u00a0\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435;\u0432\u00a0\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b (ws1.example.com,\u00a0ws2.example.com), \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u00a0\u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0447\u0430\u0449\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u0434\u0438\u043d WebSocket\u2011\u043a\u0430\u043d\u0430\u043b \u043f\u043e\u0434\u00a0\u0447\u0430\u0442\u044b \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 WebSocket\u2011\u043a\u0430\u043d\u0430\u043b \u043f\u043e\u0434\u00a0\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 realtime\u2011\u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u043b\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u00a0\u0442\u0438\u043f\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f (type\u00a0\u0432\u00a0payload\u2019\u0435).WebSocket, SSE \u0438 long\u2011polling: \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e\u00a0\u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c\u0427\u0442\u043e\u0431\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u043e\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0441\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043d\u0430\u00a0\u043e\u0434\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u00ab\u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u0439\u00bb \u043f\u043e\u00a0realtime\u2011\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c. \u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430 WebSocket SSE (Server\u2011Sent Events) Long\u2011polling\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\u0414\u0432\u0443\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (\u043a\u043b\u0438\u0435\u043d\u0442 \u2194 \u0441\u0435\u0440\u0432\u0435\u0440).\u041e\u0434\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 (\u0441\u0435\u0440\u0432\u0435\u0440 \u2192 \u043a\u043b\u0438\u0435\u043d\u0442).\u041a\u043b\u0438\u0435\u043d\u0442 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043f\u0440\u0438\u00a0\u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u043e\u0432\u0435\u0440\u0445 TCP, \u0441\u0442\u0430\u0440\u0442 \u0447\u0435\u0440\u0435\u0437 HTTP Upgrade.\u0427\u0438\u0441\u0442\u044b\u0439 HTTP (\u043f\u043e\u0442\u043e\u043a \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439).\u0427\u0438\u0441\u0442\u044b\u0439 HTTP (\u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 + \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0432\u0442\u043e\u0440)\u0424\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445\u0422\u0435\u043a\u0441\u0442 \u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u044b.\u0422\u043e\u043b\u044c\u043a\u043e&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-485182","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/485182","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=485182"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/485182\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=485182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=485182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=485182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}