{"id":369181,"date":"2024-05-21T03:57:57","date_gmt":"2024-05-21T03:57:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=369181"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=369181","title":{"rendered":"<span>\u041f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f Android \u043d\u0430 Go<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e HTTP CONNECT \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Go, \u043a\u0432\u0435\u0441\u0442 \u0441 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 Android.<\/p>\n<h3>\u0418\u043d\u0442\u0440\u043e<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u043b\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0441\u043e\u0444\u0442\u0430 \u044f \u0445\u043e\u0447\u0443 \u0431\u044b\u0442\u044c&#8230; \u0432\u0441\u0451 \u0442\u0435\u043c \u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c. \u041c\u043d\u0435 \u044d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0438 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u0432\u0435\u043a\u0430 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0414\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 &#8212; \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0433\u043e, \u0447\u0435\u0433\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c, \u0438 \u0432\u0441\u0451 \u0441\u0442\u0430\u043b\u043e \u0435\u0449\u0451 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u042d\u0442\u043e \u0442\u0430 \u0441\u0442\u0438\u0445\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0440\u044b\u0431\u0430 \u0432 \u0432\u043e\u0434\u0435.<\/p>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043c\u043e\u0438\u043c \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439, \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0435\u0439\u0441\u044f, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u044f \u043e\u0449\u0443\u0449\u0430\u044e \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0432 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0438 \u0432 \u0444\u0438\u043b\u044c\u043c\u0435 \u0422\u0440\u0430\u0441\u0441\u0430 60, \u0441 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u043c\u0438, \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438 \u0438 \u0444\u0435\u0439\u043b\u0430\u043c\u0438, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c, \u043d\u043e..<\/p>\n<blockquote>\n<p>&#171;\u041a\u0430\u043a\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430, \u0447\u0442\u043e \u0432 \u043a\u043e\u0440\u043e\u0431\u043a\u0435. \u0418\u0441\u0442\u043e\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u043d\u0430 \u043e\u0431\u0440\u043e\u0441\u043b\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u0435\u0435.&#187;<\/p>\n<\/blockquote>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0443\u0448\u043b\u043e \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443, \u043e\u0442 \u043d\u0438\u0445 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u044b\u0442. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043c\u043e\u0435\u0433\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<h3>\u0418\u0434\u0435\u044f<\/h3>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043d\u0430\u0434 \u0442\u0440\u0430\u0444\u0438\u043a\u043e\u043c, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d. \u0412\u0441\u044f\u043a\u043e\u0435 \u0431\u044b\u0432\u0430\u0435\u0442. \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432 \u0440\u043e\u0443\u043c\u0438\u043d\u0433\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043d\u0435\u0433. \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u0442\u0443\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u043e\u043a \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0445 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432 &#8212; \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0448\u0430\u043f\u0438\u0442\u043e. \u042f \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0443\u0431\u0440\u0430\u043d\u043e \u0447\u0435\u0440\u0435\u0437 adb. \u0412\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 DNS-\u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0441\u0435\u043a\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u0432 \u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u043e\u043a. \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0440\u0435\u043a\u043b\u0430\u043c\u044b \u0440\u0435\u0436\u0435\u0442 \u0435\u0451 \u043f\u043e \u043c\u0435\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043e\u0444\u0442 \u0438 \u0441\u0430\u0439\u0442\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0436\u0440\u0430\u0442\u044c \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u0414\u0430 \u0435\u0449\u0451 \u0438 \u0441\u043e\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u0437\u0431\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u043b\u0430\u0442\u0443 \u0437\u0430 \u0440\u0430\u0441\u0448\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0448\u0442\u0443\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bca\/3d6\/0a2\/bca3d60a2e4b099ef107eac33a2296c4.png\" width=\"1000\" height=\"600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bca\/3d6\/0a2\/bca3d60a2e4b099ef107eac33a2296c4.png\"\/><\/figure>\n<p>\u041f\u0440\u043e\u043a\u0441\u0438 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u043c\u043e\u0433\u0443 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0431\u0435\u0437 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430.<\/p>\n<p>\u041d\u043e \u043d\u0435 \u0432\u0437\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0435, \u0430 \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Golang. \u0411\u0435\u0437 Android Studio, Kotlin \u0438 Gradle. \u041f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<h3>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/h3>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0451\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u043e\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 (\u043a\u0440\u043e\u043c\u0435 \u0437\u0443\u0431\u043d\u043e\u0439 \u0449\u0451\u0442\u043a\u0438 \u0438 \u0442\u0435\u0440\u043c\u043e\u043c\u0435\u0442\u0440\u0430). \u041f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442, \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 mail.ru:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8b5\/b4b\/977\/8b5b4b977e76b5b353081e009f8031bf.png\" width=\"512\" height=\"1939\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b5\/b4b\/977\/8b5b4b977e76b5b353081e009f8031bf.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421 43 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0442\u044f\u043d\u0443\u043b\u043e\u0441\u044c \u043e\u043a\u043e\u043b\u043e 7 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/73b\/925\/89a\/73b92589a0e6f74ffdcd717b9327ffe9.png\" width=\"512\" height=\"640\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/73b\/925\/89a\/73b92589a0e6f74ffdcd717b9327ffe9.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u043a\u043e\u043b\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u0430 \u0441 6 \u0434\u043e\u043c\u0435\u043d\u043e\u0432. \u042d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 7 \u0440\u0430\u0437.<\/p>\n<h2>HTTP \u043f\u0440\u043e\u043a\u0441\u0438 \u043d\u0430 Go<\/h2>\n<p>\u0421\u0430\u043c\u044b\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043f\u0440\u043e\u043a\u0441\u0438 (\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 Android) &#8212; \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP-\u043f\u0440\u043e\u043a\u0441\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 HTTP \u043c\u0435\u0442\u043e\u0434 CONNECT \u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0421\u0434\u0435\u043b\u0430\u0442\u044c CONNECT-\u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 Go \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Go \u043d\u0435\u0442 \u044f\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u043a\u0441\u0438, \u043d\u043e \u0437\u0430\u0442\u043e \u043e\u043d\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0430\u0445 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 net-\u043f\u0430\u043a\u0435\u0442\u043e\u0432 Go, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043a\u043e\u0434\u0435 &#171;go\/src\/net\/http\/transport_test.go&#187;<\/p>\n<p>\u0421\u0443\u0442\u044c CONNECT-\u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u0430 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435. \u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 HTTP CONNECT \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043f\u0440\u043e\u043a\u0441\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>CONNECT google.com:443 HTTP\/1.1<\/code><\/pre>\n<p>\u041f\u0440\u043e\u043a\u0441\u0438 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u0435 (\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u0436\u0430\u0442\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) &#8212; \u0434\u0435\u043b\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0442\u043e \u043a\u043e\u0434 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">package main  import (   \"crypto\/tls\"   \"fmt\"   \"io\"   \"log\"   \"net\"   \"net\/http\" )  const proxyListenAddress = \"0.0.0.0:3128\"  func main() {   proxyServer := http.Server{     Addr:         proxyListenAddress,     Handler:      http.HandlerFunc(connectHandler),     TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){},   }   log.Println(\"Started proxy at:\", proxyServer.Addr)   if err := proxyServer.ListenAndServe(); err != nil {     log.Println(\"Server failed:\", err)   } }  func connectHandler(w http.ResponseWriter, r *http.Request) {   if r.Method != http.MethodConnect {     log.Println(\"Method not allowed:\", r.Method)     w.WriteHeader(http.StatusMethodNotAllowed)     return   }    log.Println(\"Hijacking connection:\", r.RemoteAddr, \"->\", r.URL.Host)   clientConn, _, err := w.(http.Hijacker).Hijack()   if err != nil {     log.Println(\"Hijack error:\", err)     http.Error(w, err.Error(), http.StatusInternalServerError)     return   }   defer clientConn.Close()    log.Println(\"Connecting to:\", r.URL.Host)   targetConn, err := net.Dial(\"tcp\", r.URL.Host)   if err != nil {     log.Println(\"Connect error:\", err)     writeRawResponse(clientConn, http.StatusServiceUnavailable, r)     return   }   defer targetConn.Close()    writeRawResponse(clientConn, http.StatusOK, r)    log.Println(\"Transferring:\", r.RemoteAddr, \"->\", r.URL.Host)   go func() {     io.Copy(targetConn, clientConn)     targetConn.Close()   }()   io.Copy(clientConn, targetConn)   log.Println(\"Done:\", r.RemoteAddr, \"->\", r.URL.Host) }  func writeRawResponse(conn net.Conn, statusCode int, r *http.Request) {   if _, err := fmt.Fprintf(conn, \"HTTP\/%d.%d %03d %s\\r\\n\\r\\n\", r.ProtoMajor,     r.ProtoMinor, statusCode, http.StatusText(statusCode)); err != nil {     log.Println(\"Writing response failed:\", err)   } }<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u044e:<\/p>\n<pre><code class=\"bash\">go build -o bin\/simple-proxy<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0430 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u0441 \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u043a\u0443\u0440\u043b\u043e\u043c \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"bash\">curl --proxytunnel -v --proxy http:\/\/127.0.0.1:3128 https:\/\/google.com chrome --proxy-server=http:\/\/127.0.0.1:3128<\/code><\/pre>\n<p>\u0423\u0440\u0430, \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0417\u0430\u0442\u0435\u043c \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0432\u0438\u043d\u0434\u0435, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 ARM-\u043e\u0434\u043d\u043e\u043f\u043b\u0430\u0442\u043d\u0438\u043a\u0435 &#8212; \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043e\u043a.<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0430\u043d\u0434\u0440\u043e\u0438\u0434? \u0421\u043e\u0431\u0438\u0440\u0430\u044e \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430:<\/p>\n<pre><code class=\"bash\">GOOS=android GOARCH=arm64 go build -o bin\/simple-proxy<\/code><\/pre>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u044e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 <strong>\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e Wi-Fi \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong> (\u043a\u0430\u043a \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u043a\u0441\u0442\u0430). \u041a\u043e\u043f\u0438\u0440\u0443\u044e \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0447\u0435\u0440\u0435\u0437 adb:<\/p>\n<pre><code class=\"bash\">adb push bin\/simple-proxy \/data\/local\/tmp adb shell \"cd \/data\/local\/tmp &amp;&amp; chmod u+x simple-proxy &amp;&amp; .\/simple-proxy\"<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0441\u0438 \u044d\u0442\u043e, \u0443\u0432\u044b, \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code>Started proxy at: 0.0.0.0:3128 Hijacking connection: 127.0.0.1:49467 -> google.com:443 Connecting to: google.com:443 Connect error: dial tcp: lookup google.com on [::1]:53: read udp [::1]:54776->[::1]:53: read: connection refused <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0432 termux \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435.<\/p>\n<h3>Go resolver<\/h3>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043b\u043e\u0433\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e DNS \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c ip-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u0445\u043e\u0441\u0442\u0430 &#171;google.com&#187;.<\/p>\n<p>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b DNS-\u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u0430 \u0432 Go \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/pkg.go.dev\/net#hdr-Name_Resolution\" rel=\"noopener noreferrer nofollow\">Name Resolution<\/a>, \u0434\u0435\u0442\u0430\u043b\u0438 \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 Go (\u0432 &#171;go\/src\/net&#187;).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432 \u0432\u0438\u043d\u0434\u0435 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 WinAPI \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 GetAddrInfoW. \u0412 \u043b\u0438\u043d\u043a\u0443\u0441\u0435 \u043e\u043d\u043e \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 DNS \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432 \/etc\/resolv.conf; \u043b\u0438\u0431\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 DNS \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0442\u0438\u043f\u0430 systemd-resolved, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u043a\u0443\u0434\u0430 \u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0441\u043e\u043b\u0432\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432.<\/p>\n<p>\u0412 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0436\u0435 \u0432\u0441\u0451 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e AOSP\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/source.android.com\/docs\/core\/ota\/modular-system\/dns-resolver\" rel=\"noopener noreferrer nofollow\">DNS Resolver<\/a><\/p>\n<p>\u041e\u043a, \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u0430 \u0432 Go \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e. \u041f\u0443\u0441\u0442\u044c \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0445\u043e\u0434\u0438\u0442 \u0432 DNS. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 DNS-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Adguard DNS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0440\u0435\u0436\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u0432 \u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u043e\u043a). \u0414\u0430 \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432 \u0441\u0432\u043e\u0451\u043c \u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u0442\u0438\u043f\u0430 DoH\/DoT (\u0438\u043b\u0438 \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0449\u0451 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u0440\u0435 \u0437\u0430\u0432\u0442\u0440\u0430).<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u0434\u0438\u0430\u043b\u0435\u0440 \u0441 \u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"go\">const dnsAddress = \"8.8.8.8:53\" \/\/Google DNS var dialer = createDialer()  func createDialer() *net.Dialer { resolverDialer := &amp;net.Dialer{} resolverDial := func(ctx context.Context, network, addr string) (net.Conn, error) { log.Println(\"Resolver dial:\", network, addr) return resolverDialer.DialContext(ctx, network, dnsAddress) }  resolver := &amp;net.Resolver{PreferGo: true, Dial: resolverDial} return &amp;net.Dialer{Resolver: resolver, Timeout: 60 * time.Second} }<\/code><\/pre>\n<p>\u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"go\">targetConn, err := dialer.Dial(\"tcp\", r.URL.Host)<\/code><\/pre>\n<p>\u041d\u0435 \u0441\u0430\u043c\u0430\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442. \u0421\u043e\u0431\u0438\u0440\u0430\u044e \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435:<\/p>\n<pre><code class=\"bash\">GOOS=android GOARCH=arm64 go build -o bin\/simple-proxy-resolve adb push bin\/simple-proxy-resolve \/data\/local\/tmp adb shell \"cd \/data\/local\/tmp &amp;&amp; chmod u+x simple-proxy-resolve &amp;&amp; .\/simple-proxy-resolve\"<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e, \u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430:<\/p>\n<pre><code>2024\/02\/10 15:48:13 Connect error: dial tcp: lookup google.com on [::1]:53: read udp 192.168.1.61:52554->8.8.8.8:53: i\/o timeout<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e DNS. \u041e\u043d\u043e \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0437\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0439\u0444\u0430\u0439 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443) \u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0430\u0439\u0444\u0430\u0439 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code>Transferring: 127.0.0.1:49682 -> google.com:443 Done: 127.0.0.1:49682 -> google.com:443<\/code><\/pre>\n<p>\u0412 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u043c \u0432\u0430\u0439\u0444\u0430\u0435 \u0432\u0435\u0441\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0434\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0439\u0444\u0430\u0439. \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0441\u0451\u043c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 Android \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432. \u0427\u0430\u0441\u0442\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0441\u043c\u0435\u0448\u043d\u043e\u0433\u043e &#8212; \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a \u0441\u0442\u0438\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043a\u0435, \u0438 \u043d\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0440\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<h3>\u041c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 Android<\/h3>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439: \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430\u0434\u043e \u0433\u043d\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0412 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0427\u0430\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 \u043d\u0435\u0440\u0443\u0442\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0442\u0430 \u0435\u0449\u0451 \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c\u0443 Java-\u043a\u043e\u0434\u0443:<\/p>\n<pre><code class=\"java\">import android.app.Activity; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkRequest; import android.os.Bundle; import android.util.Log;  import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;  public class MainActivity extends Activity {      @Override     protected void onCreate(Bundle savedInstanceState) {         ConnectivityManager connectivityManager =             (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);          connectivityManager.registerNetworkCallback(             new NetworkRequest.Builder().addTransportType(TRANSPORT_CELLULAR).build(),             new ConnectivityManager.NetworkCallback() {                 @Override                 public void onAvailable(Network network) {                     connectivityManager.bindProcessToNetwork(network);                     Log.i(\"GoLog\", \"Cellular network: \" + network.toString());                 }             }         );     } }<\/code><\/pre>\n<p>\u0422\u043e-\u0435\u0441\u0442\u044c \u0443 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e APK \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Java \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u043e \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u044d\u0442\u043e \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b. \u041f\u0440\u043e\u0439\u0434\u044f \u043f\u043e \u0442\u0430\u043a\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 https:\/\/android.googlesource.com\/platform\/packages\/modules\/Connectivity \u0438 https:\/\/android.googlesource.com\/platform\/system\/netd:<\/p>\n<pre><code>packages\/modules\/Connectivity\/framework\/src\/android\/net\/   - ConnectivityManager.java:bindProcessToNetwork   - ConnectivityManager.java:setProcessDefaultNetwork   - NetworkUtils.java:bindProcessToNetwork   - NetworkUtils.java:bindProcessToNetworkHandle packages\/modules\/Connectivity\/framework\/jni\/   - android_net_NetworkUtils.cpp:android_net_utils_bindProcessToNetworkHandle frameworks\/base\/native\/android\/   - net.c:android_setprocnetwork system\/netd\/client\/   - NetdClient.cpp:setNetworkForProcess   - NetdClient.cpp:setNetworkForTarget   - NetdClient.cpp:setNetworkForSocket   - FwmarkClient.cpp:send system\/netd\/server\/   - FwmarkServer.cpp:processClient <\/code><\/pre>\n<p>\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cpp\">setsockopt(*socketFd, SOL_SOCKET, SO_MARK, &amp;fwmark.intValue, sizeof(fwmark.intValue))<\/code><\/pre>\n<p>\u0433\u0434\u0435 <code>fwmark.intValue<\/code> &#8212; \u044d\u0442\u043e 32 \u0431\u0438\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0441\u043e\u043a\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c. \u0412\u043e\u0442 \u0442\u0430\u043a \u0432 C-\u043a\u043e\u0434\u0435 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u044d\u0442\u0438 \u0431\u0438\u0442\u044b:<\/p>\n<pre><code class=\"cpp\">union Fwmark {     uint32_t intValue;     struct {         uint16_t netId             : 16;         uint8_t explicitlySelected :  1;         uint8_t protectedFromVpn   :  1;         uint8_t permission         :  2;         uint8_t uidBillingDone     :  1;         uint8_t reserved           :  8;         uint8_t vendor             :  2;         uint8_t ingress_cpu_wakeup :  1;     };      constexpr Fwmark() : intValue(0) {} };<\/code><\/pre>\n<p>\u0412 &#171;system\/netd\/server\/FwmarkServer.cpp&#187; \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u044e\u043d\u0438\u043e\u043d.<\/p>\n<p>\u041d\u043e \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 <code>netId<\/code> (\u0447\u0438\u0441\u043b\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u0441 100 \u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0441\u0435\u0442\u0438) \u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u043d\u0435-Java \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u041e\u043a, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c APK \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0442\u0435\u0445 10 \u0441\u0442\u0440\u043e\u043a Java-\u043a\u043e\u0434\u0430 \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u0433\u043b\u0430\u0432\u044b, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a \u0441\u0435\u0442\u0438 \u0432 \u043b\u043e\u0433.<\/p>\n<p>\u0411\u0435\u0437 \u043e\u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0434\u0435\u0436\u0434\u044b, \u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c, \u0443\u0437\u043d\u0430\u0432 <code>netId<\/code> &#8212; \u044d\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0432 Go-\u043a\u043e\u0434\u0435:<\/p>\n<pre><code class=\"go\">syscall.SetsockoptInt(socketFd, SOL_SOCKET, SO_MARK, fwmarkIntValue)<\/code><\/pre>\n<p>\u043d\u0430 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043e\u0442 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 &#171;operation not permitted&#187;. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 &#171;system\/netd&#187; \u0434\u0430\u044e\u0442 \u043e\u0442\u0432\u0435\u0442, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u0421\u0431\u043e\u0440\u043a\u0430 Go+C<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u043e\u0434\u043d\u043e \u0438\u0437 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0442\u0435 Go-\u0441\u043e\u043a\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u043c\u0438\u0440\u043e\u043c, \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f &#171;netd\/client&#187; \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443.<\/p>\n<p>\u041a\u043e\u0434 \u0432 &#171;system\/netd\/client\/NetdClient.cpp&#187; \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0441\u043e\u043a\u0435\u0442\u0430 \u043a \u0441\u0435\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">extern \"C\" int setNetworkForSocket(unsigned netId, int socketFd) {     if (socketFd &lt; 0) {         return -EBADF;     }     FwmarkCommand command = {FwmarkCommand::SELECT_NETWORK, netId, 0};     return FwmarkClient().send(&amp;command, socketFd); }<\/code><\/pre>\n<p>\u0422\u043e-\u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c &#171;NetdClient:setNetworkForSocket&#187; \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u043a\u0435\u0442\u0430 \u0432 Go, \u043d\u043e \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 &#8212; \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u043e\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0439\u0434\u0443\u0442 \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0440\u043e\u0441\u0441-\u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"go\">\/\/go:build android &amp;&amp; cgo  package main  \/* #include &lt;NetdClient.h> *\/ import \"C\"  func setNetworkForSocket(socket uintptr, networkId uint) {   C.setNetworkForSocket(C.uint(networkId), C.int(socket)) }<\/code><\/pre>\n<p>\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 Go \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"go\">const networkId = 269 \/\/ current netId of the cellular network on my phone  func createDialer() *net.Dialer { dialerControl := func(network, address string, conn syscall.RawConn) error { controlFunc := func(socket uintptr) { log.Println(\"Dialer control:\", socket, network, address) setNetworkForSocket(socket, networkId) } return conn.Control(controlFunc) }  resolverDialer := &amp;net.Dialer{Control: dialerControl} resolverDial := func(ctx context.Context, network, addr string) (net.Conn, error) { log.Println(\"Resolver dial:\", network, addr) return resolverDialer.DialContext(ctx, network, dnsAddress) }  resolver := &amp;net.Resolver{PreferGo: true, Dial: resolverDial} return &amp;net.Dialer{ Control:  dialerControl, Resolver: resolver, Timeout:  60 * time.Second, } }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f Go \u043a\u043e\u0434\u0430 <\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"go\">\/\/go:build android &amp;&amp; cgo  package main  import ( \"context\" \"crypto\/tls\" \"fmt\" \"io\" \"log\" \"net\" \"net\/http\" \"syscall\" \"time\" )  \/* #include &lt;NetdClient.h> *\/ import \"C\"  func setNetworkForSocket(socket uintptr, networkId uint) { C.setNetworkForSocket(C.uint(networkId), C.int(socket)) }  const proxyListenAddress = \"0.0.0.0:3128\"  func main() { proxyServer := http.Server{ Addr:         proxyListenAddress, Handler:      http.HandlerFunc(connectHandler), TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, } log.Println(\"Started proxy at:\", proxyServer.Addr) if err := proxyServer.ListenAndServe(); err != nil { log.Println(\"Server failed:\", err) } }  func connectHandler(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodConnect { log.Println(\"Method not allowed:\", r.Method) w.WriteHeader(http.StatusMethodNotAllowed) return }  log.Println(\"Hijacking connection:\", r.RemoteAddr, \"->\", r.URL.Host) clientConn, _, err := w.(http.Hijacker).Hijack() if err != nil { log.Println(\"Hijack error:\", err) http.Error(w, err.Error(), http.StatusInternalServerError) return } defer clientConn.Close()  log.Println(\"Connecting to:\", r.URL.Host) targetConn, err := dialer.Dial(\"tcp\", r.URL.Host) if err != nil { log.Println(\"Connect error:\", err) writeRawResponse(clientConn, http.StatusServiceUnavailable, r) return } defer targetConn.Close()  writeRawResponse(clientConn, http.StatusOK, r)  log.Println(\"Transferring:\", r.RemoteAddr, \"->\", r.URL.Host) go func() { io.Copy(targetConn, clientConn) targetConn.Close() }() io.Copy(clientConn, targetConn) log.Println(\"Done:\", r.RemoteAddr, \"->\", r.URL.Host) }  func writeRawResponse(conn net.Conn, statusCode int, r *http.Request) { if _, err := fmt.Fprintf(conn, \"HTTP\/%d.%d %03d %s\\r\\n\\r\\n\", r.ProtoMajor, r.ProtoMinor, statusCode, http.StatusText(statusCode)); err != nil { log.Println(\"Writing response failed:\", err) } }  const dnsAddress = \"8.8.8.8:53\" \/\/Google DNS var dialer = createDialer()  const networkId = 269  func createDialer() *net.Dialer { dialerControl := func(network, address string, conn syscall.RawConn) error { controlFunc := func(socket uintptr) { log.Println(\"Dialer control:\", socket, network, address) setNetworkForSocket(socket, networkId) } return conn.Control(controlFunc) }  resolverDialer := &amp;net.Dialer{Control: dialerControl} resolverDial := func(ctx context.Context, network, addr string) (net.Conn, error) { log.Println(\"Resolver dial:\", network, addr) return resolverDialer.DialContext(ctx, network, dnsAddress) }  resolver := &amp;net.Resolver{PreferGo: true, Dial: resolverDial} return &amp;net.Dialer{ Control:  dialerControl, Resolver: resolver, Timeout:  60 * time.Second, } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c Go-\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0438\u0437 Android NDK. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430: &#171;https:\/\/dl.google.com\/android\/repository\/android-ndk-r26b-linux.zip&#187;<\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044e \u0435\u0433\u043e \u0432 &#171;~\/android_sdk&#187;.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0441\u043b\u0435\u0434\u0443\u044f Android-way, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 `sdkmanager &#171;ndk;26.2.11394342&#8243;` \u0438\u0437 Android SDK Command-line Tools.<\/p>\n<p>\u0415\u0449\u0451 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 netd. \u0421\u043c\u0430\u0440\u0442\u0444\u043e\u043d, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Android 7.1, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u0447\u0430\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0434\u043b\u044f \u043c\u043e\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<pre><code class=\"bash\">git clone --depth 1 --branch android-7.1.2_r39 --single-branch https:\/\/android.googlesource.com\/platform\/system\/netd <\/code><\/pre>\n<p>\u0421\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u0438\u0445 \u0432 &#171;~\/android_sdk\/sources-misc\/android-7.1.2_r39&#187;. <\/p>\n<p>\u0412\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u044e \u0438\u0437 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043b\u0438\u0431\u0443 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 netd-\u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0435\u0451 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0441 \u043c\u043e\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c:<\/p>\n<pre><code class=\"bash\">mkdir .\/lib64 adb pull \/system\/lib64\/libnetd_client.so .\/lib64\/ adb pull \/system\/lib64\/libc++.so .\/lib64\/<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0441\u0431\u043e\u0440\u043a\u0430 \u0447\u0443\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  TOOLCHAIN=~\/android_sdk\/ndk\/26.2.11394342\/toolchains\/llvm\/prebuilt\/linux-x86_64 ANDROID_SRC=~\/android_sdk\/sources-misc\/android-7.1.2_r39 ANDROID_API=25  export GOOS=android export GOARCH=arm64 export CGO_ENABLED=1 export CGO_LDFLAGS=\"-Llib64 -lnetd_client -lc++\" export CGO_CFLAGS=\"-I$ANDROID_SRC\/platform\/system\/netd\/include\" export CC=$TOOLCHAIN\/bin\/aarch64-linux-android$ANDROID_API-clang export CXX=$TOOLCHAIN\/bin\/aarch64-linux-android$ANDROID_API-clang++  go build -trimpath -o bin\/simple-proxy-bind<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e:<\/p>\n<pre><code class=\"bash\">adb push bin\/simple-proxy-bind \/data\/local\/tmp adb shell \"cd \/data\/local\/tmp &amp;&amp; chmod u+x simple-proxy-bind &amp;&amp; .\/simple-proxy-bind\"<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>\u0425\u043e\u0442\u044c \u0432\u0441\u0451 \u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435, \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d netId, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0441\u043e\u0431\u0440\u0430\u043d \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0430\u043c\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u0418 \u044d\u0442\u043e \u0431\u044b\u043b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<h3>\u0414\u043e\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0441\u043e\u0432\u044b<\/h3>\n<p>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0448\u0430\u0433 \u0438\u0437 \u043c\u0435\u043c\u0430 &#171;\u041a\u0430\u043a \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0443&#187;. \u041d\u043e \u0442\u0430\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0443\u0442\u0438\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e, \u0447\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u043b \u0435\u0433\u043e \u0432 \u0432\u0438\u0434\u0435 APK \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/pkg.go.dev\/golang.org\/x\/mobile\/cmd\/gomobile\" rel=\"noopener noreferrer nofollow\">gomobile<\/a>, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0430\u043d\u0434\u0440\u043e\u0438\u0434-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0445\u043e\u0442\u044f \u043f\u043e\u0437\u0436\u0435 \u044f \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0442 `gomobile build` \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u043e\u0439).<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 DNS-\u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u0445\u043e\u0441\u0442\u043e\u0432 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c whitelist\/blacklist.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u043b \u043d\u0430 Java \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Android Activity \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0430 <code>netId<\/code> \u0438\u0437 Java-\u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0432 Go \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0435\u044e <code>GoNativeActivity<\/code>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 gomobile. \u0412 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u044e \u043f\u0430\u0440\u0443 \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u043b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 (\u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435).<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043f\u0430\u043a\u043e\u0432\u0430\u043b \u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b APK \u0441 \u044d\u0442\u0438\u043c\u0438 \u0434\u043e\u0431\u0430\u0432\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>GNU make &#8212; \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0441\u0435\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>go &#8212; \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 go-\u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>clang \u0438\u0437 Android NDK &#8212; \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0421-\u043a\u043e\u0434\u0430 Android<\/p>\n<\/li>\n<li>\n<p>javac  \u0438\u0437 OpenJDK 17 &#8212; \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 Activity \u043d\u0430 Java<\/p>\n<\/li>\n<li>\n<p>zip \u0438 aapt2, apksigner, d8 \u0438\u0437 Android Platform Tools &#8212; \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 APK<\/p>\n<\/li>\n<li>\n<p>adb &#8212; \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0443<\/p>\n<\/li>\n<li>\n<p>sass \u0438 swc &#8212; \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u044e\u0430\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0437\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e Android-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f Windows \u0438\u043b\u0438 Linux.<\/p>\n<h3>UI<\/h3>\n<p>\u0421 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043b\u0451\u0433\u043a\u0438\u0439. \u0411\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0411\u0435\u0437 NodeJS, npm \u0438 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 node_modules.<\/p>\n<p>\u041d\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 TypeScript \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0433\u043e\u043b\u044b\u0439 JS. \u0418 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 <a href=\"https:\/\/swc.rs\/\" rel=\"noopener noreferrer nofollow\">SWC<\/a> \u0441\u0442\u0430\u043b\u043e \u0442\u0435\u043c \u0433\u043b\u043e\u0442\u043a\u043e\u043c \u0441\u0432\u0435\u0436\u0435\u0433\u043e \u0432\u043e\u0437\u0434\u0443\u0445\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043c\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c TS, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 NodeJS (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435).<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044e\u0430\u0439 \u0441\u0442\u0430\u043b \u0442\u0430\u043a\u0438\u043c \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u043c, \u043a\u0430\u043a\u0438\u043c (\u0432 \u043c\u043e\u0451\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438) \u043e\u043d \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c.<\/p>\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>\u042f \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043f\u0440\u043e\u043a\u0441\u0438, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0443\u0441\u043e\u0440\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0430 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435. \u0412 \u044d\u0442\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u044f:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043f\u0440\u043e\u043a\u0441\u0438 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e \u044d\u0442\u043e\u0442 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043a \u0432\u0430\u0439\u0444\u0430\u0439 \u0441\u0435\u0442\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u0430\u0439\u0444\u0430\u0439-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0431\u044f \u0436\u0435 (127.0.0.1)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438, \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0441\u0435\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u043d\u043e \u0445\u043e\u0441\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u043e\u0431\u044a\u0451\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Android \u0438 \u0443 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041d\u043e, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b &#8212; \u043c\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0438, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0435\u0449\u0451 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430.<\/p>\n<h3>Go?<\/h3>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043a\u0442\u043e-\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442: &#171;-\u0410 \u0437\u0430\u0447\u0435\u043c \u0437\u0434\u0435\u0441\u044c Go? \u041d\u0430 Java \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435, \u0434\u043b\u044f Android \u0443\u0436 \u0442\u043e\u0447\u043d\u043e!&#187;<\/p>\n<p>\u0414\u0430, \u0432\u0441\u0451 \u0432\u0435\u0440\u043d\u043e. \u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f Android. \u041d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 \u0447\u0451\u043c \u0443\u0433\u043e\u0434\u043d\u043e (\u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445), \u0438 Go \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u043e\u0440\u043e\u0448.<\/p>\n<p>\u041d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0448\u0442\u0430\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 `su` \u0438\u043b\u0438 `sudo`. \u0411\u0435\u0437 \u043d\u0438\u0445 \u0447\u0443\u0432\u0441\u0442\u0432\u043e, \u0447\u0442\u043e \u0442\u0435\u0431\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u0447\u0443\u0436\u0443\u044e \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443. \u0414\u0435\u0440\u0436\u0438\u0448\u044c \u0432 \u0440\u0443\u043a\u0430\u0445 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043c\u0431\u043e: \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u043f\u0430\u043c\u044f\u0442\u044c, \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b; \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0435, \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c, \u0434\u0430 \u0435\u0449\u0451 \u0432 \u0442\u0430\u043a\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0447\u0442\u0430\u0442\u044c. \u0418 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043a\u0430\u043a \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u041d\u0430 C, Go \u0438\u043b\u0438 \u0441\u0442\u0430\u0440\u043e\u043c \u0434\u043e\u0431\u0440\u043e\u043c \u041f\u0430\u0441\u043a\u0430\u043b\u0435.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435 Go.<\/p>\n<p>\u0425\u043e\u0442\u044f \u0434\u0430, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u043a\u0441\u0438 \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0442\u0430\u043a\u0438\u043c \u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u043e\u043c \u043d\u0430 \u0441\u043c\u0435\u0441\u0438 Go, Java \u0438 C.<\/p>\n<h3>\u0425\u0430\u0431\u0440\u0443<\/h3>\n<p>\u042f \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u0447\u0438\u0442\u0430\u044e \u0425\u0430\u0431\u0440. \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043d \u0441\u0442\u0430\u043b \u0442\u0435\u043c \u0446\u0435\u043d\u0442\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u043e\u0434\u043e\u0433\u0440\u0435\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u0438 \u043d\u0435 \u0434\u0430\u0451\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0441\u0435\u0431\u044f \u0432 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043b\u0430\u043d\u0435 (\u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0432 \u044d\u043f\u043e\u0445\u0443 \u0443\u0434\u0430\u043b\u0451\u043d\u043a\u0438).<\/p>\n<p>\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0438\u0441\u043f\u0430\u043d\u0441\u043a\u043e\u0439 \u0431\u0430\u0440\u0430\u0445\u043e\u043b\u043a\u0435, \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u0430\u0432\u043d\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0430\u0434\u0438\u043e-\u043c\u043e\u0434\u0443\u043b\u0435\u043c, \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043a\u043e\u0441\u043c\u043e\u0441, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u0434\u0435\u0442\u0430\u043b\u0438 \u0434\u0440\u0435\u0432\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0434\u0440\u0435\u0432\u0435\u0441\u0438\u043d\u0443 \u0434\u043b\u044f \u0441\u0442\u043e\u043b\u0435\u0448\u043d\u0438\u0446\u044b, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u0434\u0435\u0432\u0430\u0439\u0441\u044b \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u043e\u0432\u044b\u0435. \u0412\u0441\u0451 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u043c\u043d\u043e\u0433\u043e\u0433\u0440\u0430\u043d\u043d\u043e, \u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<p>\u0425\u0430\u0431\u0440, \u043e\u0441\u0442\u0430\u0432\u0430\u0439\u0441\u044f \u0441\u043e\u0431\u043e\u0439! \u0425\u0430\u0431\u043e\u043c \u0437\u043d\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0434\u0430\u0436\u0435 \u0441\u043f\u0443\u0441\u0442\u044f \u0433\u043e\u0434\u044b. \u041d\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0441\u044c \u0431\u043b\u043e\u0433\u043e\u043c \u0441 \u0437\u0430\u0441\u0438\u043b\u044c\u0435\u043c \u0440\u0435\u043a\u043b\u0430\u043c\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445-\u043e\u0434\u043d\u043e\u0434\u043d\u0435\u0432\u043a\u0430\u0445.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/796105\/\"> https:\/\/habr.com\/ru\/articles\/796105\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e HTTP CONNECT \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 Go, \u043a\u0432\u0435\u0441\u0442 \u0441 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 Android.<\/p>\n<h3>\u0418\u043d\u0442\u0440\u043e<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u043b\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0441\u043e\u0444\u0442\u0430 \u044f \u0445\u043e\u0447\u0443 \u0431\u044b\u0442\u044c&#8230; \u0432\u0441\u0451 \u0442\u0435\u043c \u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c. \u041c\u043d\u0435 \u044d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0438 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u0432\u0435\u043a\u0430 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0414\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 &#8212; \u0437\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u0433\u043e, \u0447\u0435\u0433\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c, \u0438 \u0432\u0441\u0451 \u0441\u0442\u0430\u043b\u043e \u0435\u0449\u0451 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u042d\u0442\u043e \u0442\u0430 \u0441\u0442\u0438\u0445\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0440\u044b\u0431\u0430 \u0432 \u0432\u043e\u0434\u0435.<\/p>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043c\u043e\u0438\u043c \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439, \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0438 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0449\u0435\u0439\u0441\u044f, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u044f \u043e\u0449\u0443\u0449\u0430\u044e \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u0432 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0438 \u0432 \u0444\u0438\u043b\u044c\u043c\u0435 \u0422\u0440\u0430\u0441\u0441\u0430 60, \u0441 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u043c\u0438, \u0443\u0441\u043f\u0435\u0445\u0430\u043c\u0438 \u0438 \u0444\u0435\u0439\u043b\u0430\u043c\u0438, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c, \u043d\u043e..<\/p>\n<blockquote>\n<p>&#171;\u041a\u0430\u043a\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430, \u0447\u0442\u043e \u0432 \u043a\u043e\u0440\u043e\u0431\u043a\u0435. \u0418\u0441\u0442\u043e\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u043d\u0430 \u043e\u0431\u0440\u043e\u0441\u043b\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u0435\u0435.&#187;<\/p>\n<\/blockquote>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0443\u0448\u043b\u043e \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443, \u043e\u0442 \u043d\u0438\u0445 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u044b\u0442. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043c\u043e\u0435\u0433\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<h3>\u0418\u0434\u0435\u044f<\/h3>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043d\u0430\u0434 \u0442\u0440\u0430\u0444\u0438\u043a\u043e\u043c, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d. \u0412\u0441\u044f\u043a\u043e\u0435 \u0431\u044b\u0432\u0430\u0435\u0442. \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432 \u0440\u043e\u0443\u043c\u0438\u043d\u0433\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043d\u0435\u0433. \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u0442\u0443\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u043e\u043a \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0445 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432 &#8212; \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0448\u0430\u043f\u0438\u0442\u043e. \u042f \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435 \u0443\u0431\u0440\u0430\u043d\u043e \u0447\u0435\u0440\u0435\u0437 adb. \u0412\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0440\u0443\u0447\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 DNS-\u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0441\u0435\u043a\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u0432 \u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u043e\u043a. \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0440\u0435\u043a\u043b\u0430\u043c\u044b \u0440\u0435\u0436\u0435\u0442 \u0435\u0451 \u043f\u043e \u043c\u0435\u0440\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041d\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043e\u0444\u0442 \u0438 \u0441\u0430\u0439\u0442\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0436\u0440\u0430\u0442\u044c \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u0414\u0430 \u0435\u0449\u0451 \u0438 \u0441\u043e\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u0437\u0431\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u043b\u0430\u0442\u0443 \u0437\u0430 \u0440\u0430\u0441\u0448\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0448\u0442\u0443\u043a\u0443:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u043a\u0441\u0438 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0441\u043c\u043e\u0433\u0443 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0431\u0435\u0437 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430.<\/p>\n<p>\u041d\u043e \u043d\u0435 \u0432\u0437\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0435, \u0430 \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Golang. \u0411\u0435\u0437 Android Studio, Kotlin \u0438 Gradle. \u041f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<h3>\u0421\u043f\u043e\u0439\u043b\u0435\u0440<\/h3>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0451\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u043e\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 (\u043a\u0440\u043e\u043c\u0435 \u0437\u0443\u0431\u043d\u043e\u0439 \u0449\u0451\u0442\u043a\u0438 \u0438 \u0442\u0435\u0440\u043c\u043e\u043c\u0435\u0442\u0440\u0430). \u041f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442, \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u0445\u043e\u0434\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 mail.ru:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"bordered\"><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0421 43 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0442\u044f\u043d\u0443\u043b\u043e\u0441\u044c \u043e\u043a\u043e\u043b\u043e 7 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"\"><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u043a\u043e\u043b\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u0430 \u0441 6 \u0434\u043e\u043c\u0435\u043d\u043e\u0432. \u042d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 7 \u0440\u0430\u0437.<\/p>\n<h2>HTTP \u043f\u0440\u043e\u043a\u0441\u0438 \u043d\u0430 Go<\/h2>\n<p>\u0421\u0430\u043c\u044b\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043f\u0440\u043e\u043a\u0441\u0438 (\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 Android) &#8212; \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTTP-\u043f\u0440\u043e\u043a\u0441\u0438, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0439 HTTP \u043c\u0435\u0442\u043e\u0434 CONNECT \u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0421\u0434\u0435\u043b\u0430\u0442\u044c CONNECT-\u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 Go \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Go \u043d\u0435\u0442 \u044f\u0432\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u043a\u0441\u0438, \u043d\u043e \u0437\u0430\u0442\u043e \u043e\u043d\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u0430\u0445 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 net-\u043f\u0430\u043a\u0435\u0442\u043e\u0432 Go, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043a\u043e\u0434\u0435 &#171;go\/src\/net\/http\/transport_test.go&#187;<\/p>\n<p>\u0421\u0443\u0442\u044c CONNECT-\u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u0430 \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435. \u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 HTTP CONNECT \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043f\u0440\u043e\u043a\u0441\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>CONNECT google.com:443 HTTP\/1.1<\/code><\/pre>\n<p>\u041f\u0440\u043e\u043a\u0441\u0438 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u0435 (\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u0436\u0430\u0442\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) &#8212; \u0434\u0435\u043b\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0442\u043e \u043a\u043e\u0434 \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">package main  import (   \"crypto\/tls\"   \"fmt\"   \"io\"   \"log\"   \"net\"   \"net\/http\" )  const proxyListenAddress = \"0.0.0.0:3128\"  func main() {   proxyServer := http.Server{     Addr:         proxyListenAddress,     Handler:      http.HandlerFunc(connectHandler),     TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){},   }   log.Println(\"Started proxy at:\", proxyServer.Addr)   if err := proxyServer.ListenAndServe(); err != nil {     log.Println(\"Server failed:\", err)   } }  func connectHandler(w http.ResponseWriter, r *http.Request) {   if r.Method != http.MethodConnect {     log.Println(\"Method not allowed:\", r.Method)     w.WriteHeader(http.StatusMethodNotAllowed)     return   }    log.Println(\"Hijacking connection:\", r.RemoteAddr, \"->\", r.URL.Host)   clientConn, _, err := w.(http.Hijacker).Hijack()   if err != nil {     log.Println(\"Hijack error:\", err)     http.Error(w, err.Error(), http.StatusInternalServerError)     return   }   defer clientConn.Close()    log.Println(\"Connecting to:\", r.URL.Host)   targetConn, err := net.Dial(\"tcp\", r.URL.Host)   if err != nil {     log.Println(\"Connect error:\", err)     writeRawResponse(clientConn, http.StatusServiceUnavailable, r)     return   }   defer targetConn.Close()    writeRawResponse(clientConn, http.StatusOK, r)    log.Println(\"Transferring:\", r.RemoteAddr, \"->\", r.URL.Host)   go func() {     io.Copy(targetConn, clientConn)     targetConn.Close()   }()   io.Copy(clientConn, targetConn)   log.Println(\"Done:\", r.RemoteAddr, \"->\", r.URL.Host) }  func writeRawResponse(conn net.Conn, statusCode int, r *http.Request) {   if _, err := fmt.Fprintf(conn, \"HTTP\/%d.%d %03d %s\\r\\n\\r\\n\", r.ProtoMajor,     r.ProtoMinor, statusCode, http.StatusText(statusCode)); err != nil {     log.Println(\"Writing response failed:\", err)   } }<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u044e:<\/p>\n<pre><code class=\"bash\">go build -o bin\/simple-proxy<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0430 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u0441 \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u043a\u0443\u0440\u043b\u043e\u043c \u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"bash\">curl --proxytunnel -v --proxy http:\/\/127.0.0.1:3128 https:\/\/google.com chrome --proxy-server=http:\/\/127.0.0.1:3128<\/code><\/pre>\n<p>\u0423\u0440\u0430, \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0417\u0430\u0442\u0435\u043c \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u043a \u0432 \u0432\u0438\u043d\u0434\u0435, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 ARM-\u043e\u0434\u043d\u043e\u043f\u043b\u0430\u0442\u043d\u0438\u043a\u0435 &#8212; \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043e\u043a.<\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0430\u043d\u0434\u0440\u043e\u0438\u0434? \u0421\u043e\u0431\u0438\u0440\u0430\u044e \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430:<\/p>\n<pre><code class=\"bash\">GOOS=android GOARCH=arm64 go build -o bin\/simple-proxy<\/code><\/pre>\n<p>\u0412\u043a\u043b\u044e\u0447\u0430\u044e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 <strong>\u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e Wi-Fi \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong> (\u043a\u0430\u043a \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u043a\u0441\u0442\u0430). \u041a\u043e\u043f\u0438\u0440\u0443\u044e \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0447\u0435\u0440\u0435\u0437 adb:<\/p>\n<pre><code class=\"bash\">adb push bin\/simple-proxy \/data\/local\/tmp adb shell \"cd \/data\/local\/tmp &amp;&amp; chmod u+x simple-proxy &amp;&amp; .\/simple-proxy\"<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0441\u0438 \u044d\u0442\u043e, \u0443\u0432\u044b, \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code>Started proxy at: 0.0.0.0:3128 Hijacking connection: 127.0.0.1:49467 -> google.com:443 Connecting to: google.com:443 Connect error: dial tcp: lookup google.com on [::1]:53: read udp [::1]:54776->[::1]:53: read: connection refused <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0432 termux \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435.<\/p>\n<h3>Go resolver<\/h3>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043b\u043e\u0433\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e DNS \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c ip-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u0445\u043e\u0441\u0442\u0430 &#171;google.com&#187;.<\/p>\n<p>\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b DNS-\u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u0430 \u0432 Go \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/pkg.go.dev\/net#hdr-Name_Resolution\" rel=\"noopener noreferrer nofollow\">Name Resolution<\/a>, \u0434\u0435\u0442\u0430\u043b\u0438 \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 Go (\u0432 &#171;go\/src\/net&#187;).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432 \u0432\u0438\u043d\u0434\u0435 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 WinAPI \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 GetAddrInfoW. \u0412 \u043b\u0438\u043d\u043a\u0443\u0441\u0435 \u043e\u043d\u043e \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 DNS \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0432 \/etc\/resolv.conf; \u043b\u0438\u0431\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 DNS \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0442\u0438\u043f\u0430 systemd-resolved, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u043a\u0443\u0434\u0430 \u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0441\u043e\u043b\u0432\u0430 \u0430\u0434\u0440\u0435\u0441\u043e\u0432.<\/p>\n<p>\u0412 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0436\u0435 \u0432\u0441\u0451 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e AOSP\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/source.android.com\/docs\/core\/ota\/modular-system\/dns-resolver\" rel=\"noopener noreferrer nofollow\">DNS Resolver<\/a><\/p>\n<p>\u041e\u043a, \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u0430 \u0432 Go \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e. \u041f\u0443\u0441\u0442\u044c \u043f\u043e\u043a\u0430 \u043e\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0445\u043e\u0434\u0438\u0442 \u0432 DNS. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 DNS-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Adguard DNS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0440\u0435\u0436\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u043a\u0435\u0440\u043e\u0432 \u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445 \u043f\u043b\u043e\u0449\u0430\u0434\u043e\u043a). \u0414\u0430 \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432 \u0441\u0432\u043e\u0451\u043c \u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u0442\u0438\u043f\u0430 DoH\/DoT (\u0438\u043b\u0438 \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0449\u0451 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u0440\u0435 \u0437\u0430\u0432\u0442\u0440\u0430).<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u0434\u0438\u0430\u043b\u0435\u0440 \u0441 \u0440\u0435\u0441\u043e\u043b\u0432\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"go\">const dnsAddress = \"8.8.8.8:53\" \/\/Google DNS var dialer = createDialer()  func createDialer() *net.Dialer { resolverDialer := &amp;net.Dialer{} resolverDial := func(ctx context.Context, network, addr string) (net.Conn, error) { log.Println(\"Resolver dial:\", network, addr) return resolverDialer.DialContext(ctx, network, dnsAddress) }  resolver := &amp;net.Resolver{PreferGo: true, Dial: resolverDial} return &amp;net.Dialer{Resolver: resolver, Timeout: 60 * time.Second} }<\/code><\/pre>\n<p>\u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"go\">targetConn, err := dialer.Dial(\"tcp\", r.URL.Host)<\/code><\/pre>\n<p>\u041d\u0435 \u0441\u0430\u043c\u0430\u044f \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442. \u0421\u043e\u0431\u0438\u0440\u0430\u044e \u0434\u043b\u044f \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435:<\/p>\n<pre><code class=\"bash\">GOOS=android GOARCH=arm64 go build -o bin\/simple-proxy-resolve adb push bin\/simple-proxy-resolve \/data\/local\/tmp adb shell \"cd \/data\/local\/tmp &amp;&amp; chmod u+x simple-proxy-resolve &amp;&amp; .\/simple-proxy-resolve\"<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e, \u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430:<\/p>\n<pre><code>2024\/02\/10 15:48:13 Connect error: dial tcp: lookup google.com on [::1]:53: read udp 192.168.1.61:52554->8.8.8.8:53: i\/o timeout<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e DNS. \u041e\u043d\u043e \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0437\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0439\u0444\u0430\u0439 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443) \u0438 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0430\u0439\u0444\u0430\u0439 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435, \u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code>Transferring: 127.0.0.1:49682 -> google.com:443 Done: 127.0.0.1:49682 -> google.com:443<\/code><\/pre>\n<p>\u0412 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u043e\u043c \u0432\u0430\u0439\u0444\u0430\u0435 \u0432\u0435\u0441\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0434\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0439\u0444\u0430\u0439. \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0441\u0451\u043c \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0438 \u0432\u0435\u0440\u0441\u0438\u0439 Android \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u043e\u0432. \u0427\u0430\u0441\u0442\u043e \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0441\u043c\u0435\u0448\u043d\u043e\u0433\u043e &#8212; \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u043a \u0441\u0442\u0438\u0440\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043a\u0435, \u0438 \u043d\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0440\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<h3>\u041c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 Android<\/h3>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439: \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0447\u0430\u0441\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430\u0434\u043e \u0433\u043d\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0412 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u0427\u0430\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 \u043d\u0435\u0440\u0443\u0442\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0435 \u0442\u0430 \u0435\u0449\u0451 \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c\u0443 Java-\u043a\u043e\u0434\u0443:<\/p>\n<pre><code class=\"java\">import android.app.Activity; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkRequest; import android.os.Bundle; import android.util.Log;  import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;  public class MainActivity extends Activity {      @Override     protected void onCreate(Bundle savedInstanceState) {         ConnectivityManager connectivityManager =             (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-369181","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/369181","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=369181"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/369181\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}