{"id":491600,"date":"2026-08-20T12:33:38","date_gmt":"2026-08-20T12:33:38","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=491600"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=491600","title":{"rendered":"librats: \u0412\u044b\u043f\u0443\u0441\u043a \u0432\u0435\u0440\u0441\u0438\u0438 2.1.x (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 P2P-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439). \u0422\u0430\u043a \u0436\u0435 \u0440\u0435\u043b\u0438\u0437 rats-search 2.2.2 \u0438 rasync"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/strong>\u00a0\u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u043d\u0430 \u0443\u0436\u0435 \u043b\u0435\u0433\u043b\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u0443 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438\u00a0<a href=\"https:\/\/github.com\/librats\/rats-search\" rel=\"noopener noreferrer nofollow\"><strong>rats-search<\/strong><\/a>\u00a0(\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0442\u043e\u0440\u0440\u0435\u043d\u0442-\u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a) \u0438\u00a0<a href=\"https:\/\/github.com\/librats\/rasync\" rel=\"noopener noreferrer nofollow\"><strong>rasync<\/strong>\u00a0<\/a>(\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043f\u043e\u043a, \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438), \u0430 \u0442\u0430\u043a\u0436\u0435, \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0435\u00a0<a href=\"https:\/\/github.com\/ultravnc\/ultravnc-librats\" rel=\"noopener noreferrer nofollow\"><strong>UltraVNC\u00a0<\/strong><\/a>(VNC-\u043a\u043b\u0438\u0435\u043d\u0442).<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e P2P-\u0441\u0435\u0442\u044c, \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0438 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0442\u043e\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u2014 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435, \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 (peer discovery), \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e <strong>\u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439<\/strong>.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f C\/C++, Java (Android), Python \u0438 Node.js.<\/p>\n<p>\u042d\u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435: \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b DHT \u0438 BitTorrent. \u041e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u2014\u00a0<strong>2.1.2<\/strong>. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f:<\/p>\n<ul>\n<li>\n<p>Windows (64-bit) \/ Windows (arm)<\/p>\n<\/li>\n<li>\n<p>Linux (64-bit) \/ Linux (arm)<\/p>\n<\/li>\n<li>\n<p>Android (32-bit \/ 64-bit)<\/p>\n<\/li>\n<li>\n<p>macOS (64-bit)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437\u00a0<strong>FFI (Foreign Function Interface)<\/strong>.  <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b7\/93c\/58b\/8b793c58ba0bed3aa5da2f7debd2cf15.png\" width=\"1560\" height=\"850\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/8b7\/93c\/58b\/8b793c58ba0bed3aa5da2f7debd2cf15.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b7\/93c\/58b\/8b793c58ba0bed3aa5da2f7debd2cf15.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u043e\u0438\u0441\u043a \u043f\u0438\u0440\u043e\u0432 \u0432 \u0441\u0435\u0442\u0438<\/strong>\u00a0\u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 DHT (\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 BitTorrent Mainline DHT) \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0447\u0435\u0440\u0435\u0437 mDNS \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0431\u0445\u043e\u0434 NAT \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430<\/strong>\u00a0\u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 UPnP, NAT-PMP, STUN, Hole punching (\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c PEX). \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0430\u043c\u0430 \u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u043e\u0443\u0442\u0435\u0440 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u0440\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0438\u0440\u044b \u0437\u0430 NAT \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0440\u0443\u0447\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u043a\u0432\u043e\u0437\u043d\u043e\u0435 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>\u00a0\u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Noise (Curve25519 + ChaCha20-Poly1305) \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/strong>\u00a0\u2014 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0446\u0435\u043b\u044b\u0445 \u043f\u0430\u043f\u043e\u043a \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0430\u0443\u0437\u044b\/\u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\/\u043e\u0442\u043c\u0435\u043d\u044b \u0438 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438<\/strong>\u00a0\u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b GossipSub \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438\/\u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043f\u043e \u0442\u0435\u043c\u0430\u043c \u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0438\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432<\/strong>\u00a0\u2014 \u0435\u0434\u0438\u043d\u044b\u0439 API \u0434\u043b\u044f C++, C, Node.js (\u0441 TypeScript), Java\/Android \u0438 Python, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 Windows, Linux, macOS \u0438 Android.<\/p>\n<\/li>\n<li>\n<p><strong>\u0423\u0434\u043e\u0431\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/strong>\u00a0\u2014 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c (<code>on()<\/code>,\u00a0<code>once()<\/code>,\u00a0<code>off()<\/code>), \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 JSON, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0433\u0438\u0431\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 2.1.x: \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0430\u0432\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u0432\u0435\u0440\u0445 UDP \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 TCP \u0431\u043b\u0438\u0437\u043a\u043e\u0433\u043e \u043f\u043e \u0434\u0443\u0445\u0443 \u043a QUIC. \u0412 UDP-\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0442\u0435 \u0436\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438: \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 ACK \u0441 32-\u0431\u0438\u0442\u043d\u043e\u0439 SACK-\u0431\u0438\u0442\u043c\u0430\u043f\u043e\u0439, RTO \u043f\u043e RFC 6298 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c \u041a\u0430\u0440\u043d\u0430, fast retransmit \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u043f\u043e SACK, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 Reno, \u043f\u043e\u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 flow control.<\/p>\n<p>\u041e\u0431\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u0440\u0430\u0432\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u044b \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: \u0435\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u0438 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d UDP, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d TCP, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 UDP Hole Punching \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c PEX (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b <strong>DCUtR<\/strong>).<\/p>\n<p>\u041d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u0440\u0430\u0437\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0437 2.1.x:<\/p>\n<pre><code class=\"cpp\">#include &lt;librats\/node\/node.h&gt;#include &lt;librats\/subsystems\/dht_discovery.h&gt;#include &lt;librats\/subsystems\/mdns_discovery.h&gt;#include &lt;librats\/subsystems\/peer_exchange.h&gt;#include &lt;librats\/subsystems\/hole_punch.h&gt;#include &lt;librats\/subsystems\/port_mapping_service.h&gt;#include &lt;librats\/subsystems\/reconnection.h&gt;#include &lt;librats\/subsystems\/ping_service.h&gt;#include &lt;librats\/subsystems\/pubsub.h&gt;NodeConfig config;config.listen_port = port;config.data_dir    = data_dir;\/\/ \u043e\u0431\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 (\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)config.enable_udp            = true;config.enable_tcp            = true;\/\/ \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u043c?config.preferred_transport   = TransportKind::Udp;Node node(config);\/\/ \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u2014\/\/ DHT (WAN): \u043a\u043b\u044e\u0447\u043e\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u043e\u043c\u043d\u0430\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0437\u043b\u044b \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b.DhtDiscovery::Config dc;dc.discovery_key = room;dc.data_dir      = data_dir;      \/\/ \u0445\u0440\u0430\u043d\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043cnode.add_subsystem(std::make_unique&lt;DhtDiscovery&gt;(std::move(dc)));\/\/ mDNS (LAN): \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0440\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.node.add_subsystem(std::make_unique&lt;MdnsDiscovery&gt;());\/\/ PEX: \u0443\u0437\u043d\u0430\u0432 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u043f\u0438\u0440\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0435\u043c\u0443 \u043f\u0438\u0440\u043e\u0432 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u043d\u0438\u043c.node.add_subsystem(std::make_unique&lt;PeerExchange&gt;());\/\/ \u2014 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 NAT \u2014\/\/ UPnP \/ NAT-PMP: \u043f\u0440\u043e\u0441\u0438\u043c \u0440\u043e\u0443\u0442\u0435\u0440 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430\u0448 \u043f\u043e\u0440\u0442 \u0441\u043d\u0430\u0440\u0443\u0436\u0438. \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043c\u0430\u043f\u044f\u0442\u0441\u044f\/\/ \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u0430 \u2014 \u0440\u043e\u0443\u0442\u0435\u0440 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0430\/\/ \u043e\u0434\u0438\u043d \u0438 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c.node.add_subsystem(std::make_unique&lt;PortMappingService&gt;());\/\/ HolePunchHolePunch::Config hp;hp.enable_relay = true; \/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u043f\u0438\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0431\u0438\u0432\u043e\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 (DCUtR)node.add_subsystem(std::make_unique&lt;HolePunch&gt;(std::move(hp)));\/\/ Reconnection \/ Ping \/ PubSub \u2014 \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435.node.add_subsystem(std::make_unique&lt;ReconnectionService&gt;(rc));node.add_subsystem(std::make_unique&lt;PingService&gt;());auto* pubsub = node.add_subsystem(std::make_unique&lt;PubSub&gt;());<\/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>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u043e\u043c\u0438\u043c\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f HolePunch, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0443\u0442\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 librats. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0430\u043a\u0435\u0442 <strong>librats \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Microsoft \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 vcpkg<\/strong>, \u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u044d\u0442\u043e \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0418 \u0434\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 vcpkg<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a7c\/a84\/4e3\/a7ca844e35f4c7988734deed3c492b7a.png\" width=\"1101\" height=\"183\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a7c\/a84\/4e3\/a7ca844e35f4c7988734deed3c492b7a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a7c\/a84\/4e3\/a7ca844e35f4c7988734deed3c492b7a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<hr\/>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0432\u044b\u0448\u043b\u0430 \u0438 \u043d\u043e\u0432\u0430\u044f, \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f rats-search (\u0442\u043e\u0440\u0440\u0435\u043d\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0430) \u2014 2.2.2. \u041e\u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p><a href=\"https:\/\/github.com\/librats\/rats-search\/releases\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/librats\/rats-search\/releases<\/a>  <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c98\/971\/e64\/c98971e64dae60df67e9632f066d1724.png\" width=\"1392\" height=\"936\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c98\/971\/e64\/c98971e64dae60df67e9632f066d1724.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c98\/971\/e64\/c98971e64dae60df67e9632f066d1724.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/028\/640\/188\/02864018802878a32b3e8168c3bfd40b.png\" width=\"861\" height=\"717\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/028\/640\/188\/02864018802878a32b3e8168c3bfd40b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/028\/640\/188\/02864018802878a32b3e8168c3bfd40b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<hr\/>\n<p>\u0412\u044b\u0448\u0435\u043b \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 librats \u2014 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0430\u043f\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438\u00a0<strong>rasync\u00a0<\/strong>(\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 rsync). \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u0438\u0445 \u0432 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0423\u0441\u043b\u043e\u0432\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u2014 \u044d\u0442\u043e Syncthing \u043d\u0430 Go, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f, \u043d\u0430 C++, \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0430\u044f.<\/p>\n<p><a href=\"https:\/\/github.com\/librats\/rasync\/releases\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/librats\/rasync\/releases<\/a><\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a. \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435:<\/p>\n<pre><code>rasync --key s3cr3t --discover .\/documents .\/photos .\/code<\/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>\u0433\u0434\u0435 \u043a\u043b\u044e\u0447 \u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043a\u043b\u044e\u0447\u043e\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u043a\u043b\u044e\u0447\u043e\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435, \u0432 \u0446\u0435\u043b\u043e\u043c, \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u2014 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0442\u0435 \u0436\u0435 \u043f\u0430\u043f\u043a\u0438 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c\u0438 \u0438 \u043a\u043e\u0434\u043e\u043c. \u0418 \u0442\u0430\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0433\u0434\u0435 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f.<\/p>\n<p>\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430<\/p>\n<pre><code>rasync --key s3cr3t --discover .\/somefolder --name documents .\/photos .\/code<\/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>\u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c. \u0410 &#8212;discover \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 (mDNS\/DHT).  <\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a69\/5e0\/38f\/a695e038fd2eb2fea1dc2ebf1fbc068f.png\" width=\"1560\" height=\"389\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a69\/5e0\/38f\/a695e038fd2eb2fea1dc2ebf1fbc068f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a69\/5e0\/38f\/a695e038fd2eb2fea1dc2ebf1fbc068f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/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\/1072550\/\">https:\/\/habr.com\/ru\/articles\/1072550\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!\u00a0\u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u043d\u0430 \u0443\u0436\u0435 \u043b\u0435\u0433\u043b\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u0443 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438\u00a0rats-search\u00a0(\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0442\u043e\u0440\u0440\u0435\u043d\u0442-\u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a) \u0438\u00a0rasync\u00a0(\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u043f\u043e\u043a, \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438), \u0430 \u0442\u0430\u043a\u0436\u0435, \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0435\u00a0UltraVNC\u00a0(VNC-\u043a\u043b\u0438\u0435\u043d\u0442).\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e P2P-\u0441\u0435\u0442\u044c, \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0438 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0442\u043e\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u2014 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435, \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 (peer discovery), \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f C\/C++, Java (Android), Python \u0438 Node.js.\u042d\u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435: \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b DHT \u0438 BitTorrent. \u041e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u2014 \u0434\u0430\u043b\u0435\u0435.\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u2014\u00a02.1.2. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f:Windows (64-bit) \/ Windows (arm)Linux (64-bit) \/ Linux (arm)Android (32-bit \/ 64-bit)macOS (64-bit)\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d \u0447\u0435\u0440\u0435\u0437\u00a0FFI (Foreign Function Interface).  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438:\u041f\u043e\u0438\u0441\u043a \u043f\u0438\u0440\u043e\u0432 \u0432 \u0441\u0435\u0442\u0438\u00a0\u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 DHT (\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 BitTorrent Mainline DHT) \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0447\u0435\u0440\u0435\u0437 mDNS \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439.\u041e\u0431\u0445\u043e\u0434 NAT \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430\u00a0\u2014 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 UPnP, NAT-PMP, STUN, Hole punching (\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c PEX). \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0430\u043c\u0430 \u043f\u0440\u043e\u0441\u0438\u0442 \u0440\u043e\u0443\u0442\u0435\u0440 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u0440\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0438\u0440\u044b \u0437\u0430 NAT \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0440\u0443\u0447\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.\u0421\u043a\u0432\u043e\u0437\u043d\u043e\u0435 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u00a0\u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b Noise (Curve25519 + ChaCha20-Poly1305) \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0441\u0442\u044c\u044e.\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u00a0\u2014 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0446\u0435\u043b\u044b\u0445 \u043f\u0430\u043f\u043e\u043a \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0430\u0443\u0437\u044b\/\u0432\u043e\u0437\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\/\u043e\u0442\u043c\u0435\u043d\u044b \u0438 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u043e\u0439.\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438\u00a0\u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b GossipSub \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438\/\u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043f\u043e \u0442\u0435\u043c\u0430\u043c \u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0438\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439.\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u00a0\u2014 \u0435\u0434\u0438\u043d\u044b\u0439 API \u0434\u043b\u044f C++, C, Node.js (\u0441 TypeScript), Java\/Android \u0438 Python, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 Windows, Linux, macOS \u0438 Android.\u0423\u0434\u043e\u0431\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u00a0\u2014 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c (on(),\u00a0once(),\u00a0off()), \u043e\u0431\u043c\u0435\u043d \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 JSON, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0433\u0438\u0431\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 2.1.x: \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0430\u0432\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u0432\u0435\u0440\u0445 UDP \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 TCP \u0431\u043b\u0438\u0437\u043a\u043e\u0433\u043e \u043f\u043e \u0434\u0443\u0445\u0443 \u043a QUIC. \u0412 UDP-\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0442\u0435 \u0436\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438: \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0439 ACK \u0441 32-\u0431\u0438\u0442\u043d\u043e\u0439 SACK-\u0431\u0438\u0442\u043c\u0430\u043f\u043e\u0439, RTO \u043f\u043e RFC 6298 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c \u041a\u0430\u0440\u043d\u0430, fast retransmit \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043e\u0432 \u043f\u043e SACK, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 Reno, \u043f\u043e\u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 flow control.\u041e\u0431\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 \u0440\u0430\u0432\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u044b \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f: \u0435\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0435\u0442\u0438 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d UDP, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d TCP, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 UDP Hole Punching \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c PEX (\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b DCUtR).\u041d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u0440\u0430\u0437\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0437 2.1.x:#include &lt;librats\/node\/node.h&gt;#include &lt;librats\/subsystems\/dht_discovery.h&gt;#include &lt;librats\/subsystems\/mdns_discovery.h&gt;#include &lt;librats\/subsystems\/peer_exchange.h&gt;#include &lt;librats\/subsystems\/hole_punch.h&gt;#include &lt;librats\/subsystems\/port_mapping_service.h&gt;#include &lt;librats\/subsystems\/reconnection.h&gt;#include &lt;librats\/subsystems\/ping_service.h&gt;#include &lt;librats\/subsystems\/pubsub.h&gt;NodeConfig config;config.listen_port = port;config.data_dir    = data_dir;\/\/ \u043e\u0431\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u0430 (\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)config.enable_udp            = true;config.enable_tcp            = true;\/\/ \u043a\u0430\u043a\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u043c?config.preferred_transport   = TransportKind::Udp;Node node(config);\/\/ \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u2014\/\/ DHT (WAN): \u043a\u043b\u044e\u0447\u043e\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u043a\u043e\u043c\u043d\u0430\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0437\u043b\u044b \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043d\u0430\u0442\u044b.DhtDiscovery::Config dc;dc.discovery_key = room;dc.data_dir      = data_dir;      \/\/ \u0445\u0440\u0430\u043d\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043cnode.add_subsystem(std::make_unique&lt;DhtDiscovery&gt;(std::move(dc)));\/\/ mDNS (LAN): \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0440\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.node.add_subsystem(std::make_unique&lt;MdnsDiscovery&gt;());\/\/ PEX: \u0443\u0437\u043d\u0430\u0432 \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u043f\u0438\u0440\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0435\u043c\u0443 \u043f\u0438\u0440\u043e\u0432 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u043d\u0438\u043c.node.add_subsystem(std::make_unique&lt;PeerExchange&gt;());\/\/ \u2014 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 NAT \u2014\/\/ UPnP \/ NAT-PMP: \u043f\u0440\u043e\u0441\u0438\u043c \u0440\u043e\u0443\u0442\u0435\u0440 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430\u0448 \u043f\u043e\u0440\u0442 \u0441\u043d\u0430\u0440\u0443\u0436\u0438. \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043c\u0430\u043f\u044f\u0442\u0441\u044f\/\/ \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0431\u0430 \u2014 \u0440\u043e\u0443\u0442\u0435\u0440 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0430\/\/ \u043e\u0434\u0438\u043d \u0438 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c.node.add_subsystem(std::make_unique&lt;PortMappingService&gt;());\/\/ HolePunchHolePunch::Config hp;hp.enable_relay = true; \/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u043f\u0438\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0431\u0438\u0432\u043e\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 (DCUtR)node.add_subsystem(std::make_unique&lt;HolePunch&gt;(std::move(hp)));\/\/ Reconnection \/ Ping \/ PubSub \u2014 \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435.node.add_subsystem(std::make_unique&lt;ReconnectionService&gt;(rc));node.add_subsystem(std::make_unique&lt;PingService&gt;());auto* pubsub = node.add_subsystem(std::make_unique&lt;PubSub&gt;());\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u043e\u043c\u0438\u043c\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f HolePunch, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0443\u0442\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 librats. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0430\u043a\u0435\u0442 librats \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Microsoft \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 vcpkg, \u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u044d\u0442\u043e \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043b\u044e\u0431\u044b\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0439.\u0418 \u0434\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 vcpkg\u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0432\u044b\u0448\u043b\u0430 \u0438 \u043d\u043e\u0432\u0430\u044f, \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f rats-search (\u0442\u043e\u0440\u0440\u0435\u043d\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u0430) \u2014 2.2.2. \u041e\u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.https:\/\/github.com\/librats\/rats-search\/releases  \u0412\u044b\u0448\u0435\u043b \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 librats \u2014 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u0430\u043f\u043e\u043a \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438\u00a0rasync\u00a0(\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 rsync). \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u0438\u0445 \u0432 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0423\u0441\u043b\u043e\u0432\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u2014 \u044d\u0442\u043e Syncthing \u043d\u0430 Go, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f, \u043d\u0430 C++, \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0430\u044f.https:\/\/github.com\/librats\/rasync\/releases\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a. \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435:rasync &#8212;key s3cr3t &#8212;discover .\/documents .\/photos .\/code\u0433\u0434\u0435 \u043a\u043b\u044e\u0447 \u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u043a\u043b\u044e\u0447\u043e\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u043a\u043b\u044e\u0447\u043e\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435, \u0432 \u0446\u0435\u043b\u043e\u043c, \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u2014 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0442\u0435 \u0436\u0435 \u043f\u0430\u043f\u043a\u0438 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u043c\u0438 \u0438 \u043a\u043e\u0434\u043e\u043c. \u0418 \u0442\u0430\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0433\u0434\u0435 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f.\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430rasync &#8212;key s3cr3t &#8212;discover .\/somefolder &#8212;name documents .\/photos .\/code\u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c. \u0410 &#8212;discover \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 (mDNS\/DHT).  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1072550\/<\/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-491600","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/491600","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=491600"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/491600\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=491600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=491600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=491600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}