{"id":444320,"date":"2025-01-08T21:00:46","date_gmt":"2025-01-08T21:00:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444320"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444320","title":{"rendered":"<span>C\u043e\u0432\u043c\u0435\u0449\u0430\u0435\u043c Haproxy, Vless, WebSocket, VPN \u0438 \u0441\u0430\u0439\u0442 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0440\u0442\u0443<\/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>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u044f \u0431\u0443\u0434\u0443 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043b\u044f \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438.  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e VPN \u043f\u0438\u0441\u0430\u0442\u044c \u0443 \u043d\u0430\u0441 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e, \u043d\u0430\u043f\u0438\u0448\u0443 \u043f\u0440\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0432 Haproxy, \u043f\u0440\u043e VPN \u0434\u0430\u043c \u043b\u0438\u0448\u044c \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e VPS \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0420\u0424 \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e, \u043c\u044b \u0432\u0435\u0434\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0437\u0430\u0449\u0438\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u0442\u0430\u043a?! \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c<\/p>\n<p>1. \u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0434\u043e\u043c\u0435\u043d\u0430 (\u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u0430), \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u044b \u0445\u043e\u0441\u0442\u0435\u0440\u0430.<br \/>2. \u0421\u0430\u043c VPS (\u043b\u0443\u0447\u0448\u0435 2 \u044f\u0434\u0440\u0430) \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0442\u0435\u0441\u0442\u043e\u0432 \u043a\u0430\u043d\u0430\u043b \u0432 200\u043c\u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0442\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442 150 \u0434\u043e 190\u043c\u0431\u0438\u0442, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0436\u0443 \u043d\u0430 Ubuntu 22.04 LTS<br \/>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043e\u0442 sudo \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<br \/> <code>sudo apt update &amp;&amp; apt upgrade -y<\/code>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:    <br \/><code>sudo apt install -y haproxy netcat-traditional htop<\/code>  <\/p>\n<p>\u0424\u0430\u0435\u0440\u0432\u043e\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438? \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c<br \/><code>sudo ufw allow 22\/tcp<\/code> \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c ssh (\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438)<br \/><code>sudo ufw allow 80,443\/tcp<\/code> \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a Web \u043f\u043e\u0440\u0442\u0430\u043c<br \/>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c DH, \u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u043e \u0436\u0434\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f<br \/><code>sudo openssl dhparam -out \/etc\/haproxy\/dh4096.pem 4096<\/code> <\/p>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c Haproxy<\/p>\n<p><\/strong>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e acme.sh \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0438 deploy \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 <a href=\"https:\/\/www.haproxy.com\/blog\/haproxy-and-let-s-encrypt\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p><strong>\u0412 \u0441\u0435\u043a\u0446\u0438\u044e global<\/strong>, \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0448\u0438\u0444\u0440\u044b, \u043e\u0441\u0442\u0430\u0432\u0438\u043c TLSv1.2 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 TLSv1.3:<\/p>\n<pre><code>global         log \/dev\/log    local0         log \/dev\/log    local1 notice         chroot \/var\/lib\/haproxy         stats socket \/var\/run\/haproxy\/admin.sock level admin mode 660          setenv ACCOUNT_THUMBPRINT '(\u0432\u0430\u0448 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 acme)'         stats timeout 30s         user    haproxy         group   haproxy         daemon         ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-bind-options prefer-client-ciphers no-tls-tickets ssl-min-ver TLSv1.2         ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-server-options no-tls-tickets ssl-min-ver TLSv1.2         ssl-dh-param-file \/etc\/haproxy\/dh4096.pem  <\/code><\/pre>\n<p><strong>\u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044e defaults<\/strong>, \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440 DNS \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c timeout, \u0434\u043b\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c 1 \u0447\u0430\u0441.<\/p>\n<pre><code>defaults        log global        mode http        option httplog        option dontlognull        timeout connect 20s        timeout client  20s        timeout server  20s        timeout tunnel  1h        timeout http-request 20s        errorfile 400 \/etc\/haproxy\/errors\/400.http        errorfile 403 \/etc\/haproxy\/errors\/403.http        errorfile 408 \/etc\/haproxy\/errors\/408.http        errorfile 500 \/etc\/haproxy\/errors\/500.http        errorfile 502 \/etc\/haproxy\/errors\/502.http        errorfile 503 \/etc\/haproxy\/errors\/503.http        errorfile 504 \/etc\/haproxy\/errors\/504.http resolvers dnsserver         nameserver ns1 127.0.0.53:53         parse-resolv-conf         resolve_retries       3         timeout resolve       1s         timeout retry         1s         hold other           30s         hold refused         30s         hold nx              30s         hold timeout         30s         hold valid           10s         hold obsolete        30s frontend stats         mode http         bind 127.0.0.1:58080         stats enable         stats uri \/stats         stats realm Haproxy\\ Statistics         stats refresh 10s         stats auth user:password         stats show-legends         stats hide-version<\/code><\/pre>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c TCP frontend<\/strong>, \u043f\u0440\u0430\u0432\u0438\u043b\u0430 acl \u0438 backend  \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 http frontend \u0438 vless<\/p>\n<pre><code>frontend tcp         bind *:80,*:443         mode tcp         option tcplog         tcp-request inspect-delay 10s         tcp-request content capture req.ssl_sni len 10         tcp-request content accept if { req_ssl_hello_type 1 } or !{ req_ssl_hello_type 1 }         use_backend vless if { req.ssl_sni -i api-app.$\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d }          use_backend tcp_to_http if { dst_port 80 } #redirect https         default_backend tcp_to_https # \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043d\u0430 frontend http  #        use_backend ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 } or !{ req.ssl_hello_type 1 } { req.len 0 }  backend tcp_to_http         mode tcp         server http 127.0.0.1:8080 send-proxy-v2-ssl-cn backend tcp_to_https         mode tcp         timeout tunnel 1h         timeout client 50s         timeout server 50s         server https 127.0.0.1:8443 send-proxy-v2-ssl-cn backend vless #x-ui         mode tcp         timeout tunnel 2h         balance roundrobin         server s1 127.0.0.1:4444 check send-proxy #backend ssh #        mode tcp #        timeout tunnel 2h #        balance roundrobin #        server s1 127.0.0.1:22 check <\/code><\/pre>\n<p>\u0421\u043b\u0443\u0448\u0430\u0435\u043c 80 \u0438 443 \u043f\u043e\u0440\u0442 \u0432 tcp \u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c SNI, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 SNI \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 http frontend.<\/p>\n<p>\u0412\u0441\u0435 \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u043d\u0430 80 \u043f\u043e\u0440\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 backend tcp_to_http \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u043d\u0430 https \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 http frontend, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c proxy protocol v2 ssl cn \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043d\u0430 frontend.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c use_backend ssh \u0438 backend ssh \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 ssh \u043d\u0430 443 \u043f\u043e\u0440\u0442\u0443. <\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0435\u043a\u0446\u0438\u044f frontend http:<\/strong> <\/p>\n<pre><code>frontend https         bind 127.0.0.1:8080 accept-proxy         bind 127.0.0.1:8443 accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 strict-sni         http-request deny if { req.hdr(user-agent) -m len le 32 }         http-request deny if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. }         http-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains; preload;\"         redirect scheme https if !{ ssl_fc }         http-request return status 200 content-type text\/plain lf-string \"%[path,field(-1,\/)].${ACCOUNT_THUMBPRINT}\\n\" if { path_beg '\/.well-known\/acme-challenge\/' } #\u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c haproxy \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b LE         use_backend wstunnel1 if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path \/wss-secretpath1 } || { path_beg \/wss-secretpath1\/ }         use_backend wstunnel2 if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path \/wss-secretpath2 } || { path_beg \/wss-secretpath2\/ }          use_backend http_xui if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path_beg \/xui-secretpath\/ } || { path_beg \/xui-secretpath }          use_backend http_stats if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path_beg \/stats-secretpath\/ }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043d\u0430\u0448 http \u0444\u0440\u043e\u043d\u0442\u0435\u0434 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u0445 8080 \u0438 8443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c http \u043d\u0430 https \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS \u0447\u0442\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e https.<\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c acl:<\/strong><br \/><code>use_backend wstunnel<\/code> \u0438 \u043d\u043e\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043a\u0430\u043a \u0437\u0430 WebSocket, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043b-\u0432\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 wstunnel.<\/p>\n<p><code>use_backend http_xui<\/code> \u0442\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e xui \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 54321 \u0442\u0443\u0434\u0430 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u043c.<\/p>\n<p><code>use_backend http_stats<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 defaults, \u0441 \u043b\u043e\u0433\u0438\u043d\u043e\u043c \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c user:password (\u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c?)<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 <code>path_beg<\/code> \u0438 <code>path<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0438, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432 x-ui \u043f\u0443\u0442\u044c, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 <code>default_backend http_xui<\/code> \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u043e\u0440\u0442, <code>ufw allow 54321\/tcp<\/code> \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u0430\u043a \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0432 allow \u043d\u0430 deny. <\/p>\n<p><strong>\u0421\u0435\u043a\u0446\u0438\u044f backend http:<\/strong><\/p>\n<pre><code>backend wstunnel1         mode http         option http-keep-alive         timeout connect 30s         timeout http-keep-alive 30s         timeout client 50s         timeout server 50s         timeout tunnel 4h         balance roundrobin         server s1 127.0.0.5:54443 backend wstunnel2         mode http         option http-keep-alive         timeout connect 30s         timeout http-keep-alive 30s         timeout client 50s         timeout server 50s         #option http-server-close         timeout tunnel 4h         balance roundrobin         server s1 127.0.0.5:5453  backend http_xui         mode http         option httpchk         option forwardfor         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-request add-header X-Real-Ip %[src]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request set-header X-Forwarded-Proto http if !{ ssl_fc }         server x-ui 127.0.0.1:54321 backend http_stats         mode http         http-request replace-path \/stats-secretpath(\/)?(.*) \/\\2         server stats 127.0.0.1:58080 <\/code><\/pre>\n<p><code>backend wstunnel<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 WebSocket, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u0434\u0432\u0430.<\/p>\n<p><code>backend http_xui<\/code> \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u0435\u0431 \u043f\u0430\u043d\u0435\u043b\u044c x-ui.<\/p>\n<p><code>http_stats<\/code> \u0437\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0444\u0438\u0433 haproxy \u0433\u043e\u0442\u043e\u0432, \u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b (\u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b) \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0431\u0435\u043a\u0435\u043d\u0434\u043e\u0432.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/github.com\/erebe\/wstunnel\" rel=\"noopener noreferrer nofollow\">wstunnel \u043e\u0442 erebe<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u0447\u0435\u0440\u0435\u0437 websocket, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u0449\u0438\u0439 socks5 \u043f\u0440\u043e\u043a\u0441\u0438, \u043b\u0438\u0431\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435:<br \/>\u0411\u0435\u0440\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b release \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f 10.1.8.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432 etc:<br \/> <code>sudo mkdir \/etc\/wstunnel<\/code> <br \/>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043d\u0435\u0435: <br \/><code>sudo cd \/etc\/wstunnel<\/code> <br \/>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0440\u0435\u043b\u0438\u0437 wstunnel:<br \/> <code>wget https:\/\/github.com\/erebe\/wstunnel\/releases\/download\/v10.1.8\/wstunnel_10.1.8_linux_amd64.tar.gz<\/code> <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 wstunnel:<br \/><code>sudo adduser --system wstunnel<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0433\u0440\u0443\u043f\u043f\u0443:<br \/><code>sudo addgroup wstunnel<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443:<br \/><code>sudo usermod -aG wstunnel wstunnel<\/code><\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c <code>tar -xvf wstunnel_10.1.8_linux_amd64.tar.gz<\/code> <br \/>\u0423 \u043d\u0430\u0441 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b wstunnel, \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <br \/><code>sudo chown wstunnel:wstunnel .\/wstunnel<\/code><br \/> \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c <br \/><code>sudo chmod 700 .\/wstunnel<\/code> <\/p>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f c \u0438\u043c\u0435\u043d\u0435\u043c socks<br \/><code>nano \/etc\/wstunnel\/socks.sh<\/code>  \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 WSTUNNEL_PATH=\"\/etc\/wstunnel\/wstunnel\"  # \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u043a wstunnel WS_URL=\"ws:\/\/127.0.0.5:14443\"           # URL \u0434\u043b\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f RESTRICT_PATH_PREFIX=\"wss-secretpath1\"  # \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u0434\u043b\u044f --restrict-http-upgrade-path-prefix PING_TARGET=\"127.0.0.5\"                 # \u0426\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0438\u043d\u0433\u0430 CHECK_PORT=14443                        # \u041f\u043e\u0440\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 CHECK_INTERVAL=10                       # \u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445  # \u0417\u0430\u043f\u0443\u0441\u043a wstunnel start_tunnel() {     echo \"\u0417\u0430\u043f\u0443\u0441\u043a wstunnel...\"     $WSTUNNEL_PATH server $WS_URL --restrict-http-upgrade-path-prefix $RESTRICT_PATH_PREFIX &amp;     TUNNEL_PID=$! }  # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f check_tunnel() {     while true; do         # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0440\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e netcat         if ! nc -z $PING_TARGET $CHECK_PORT; then             echo \"\u0422\u0443\u043d\u043d\u0435\u043b\u044c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a...\"             kill $TUNNEL_PID             start_tunnel         fi         sleep $CHECK_INTERVAL     done } # \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 start_tunnel check_tunnel<\/code><\/pre>\n<p><em>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 &#171;\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430&#187; \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0438, <\/em><strong><em>RESTRICT_PATH_PREFIX<\/em><\/strong><em> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u0438 <\/em><strong><em>\u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b \u0441 haproxy<\/em><\/strong><em>. \u0421\u0435\u043a\u0446\u0438\u044f &#171;\u0417\u0430\u043f\u0443\u0441\u043a wstunnel&#187; \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043d\u0430\u0448 wstunnel \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0421\u0435\u043a\u0446\u0438\u044f &#171;<\/em><strong><em>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f<\/em><\/strong><em>&#187; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0434\u043d\u044f\u0442\u043e\u0433\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u043f\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c netcat, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430 wstunnel \u0435\u0441\u043b\u0438 \u043f\u043e\u0440\u0442 \u0437\u0430\u043a\u0440\u044b\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u043d\u0430\u043c wstunnel.<\/em><\/p>\n<p>\u041f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f: <br \/><code>sudo chown wstunnel:wstunnel .\/socks.sh<\/code><\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c:<br \/> <code>sudo chmod 700<\/code> <code>.\/socks.sh<\/code> <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 <code>.\/socks.sh<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u043e\u043c DNS \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043d\u0430\u0448\u0438\u0445 DNS \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<br \/><code>sudo nano<\/code> <code>\/etc\/wstunnel\/dns.sh<\/code> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c (\u0432\u044b \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0434\u043b\u044f ssh \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0435\u0449\u0435 backend \u0438 frontend \u0432 haproxy \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0443\u0442\u0435\u043c):<\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 WSTUNNEL_PATH=\"\/etc\/wstunnel\/wstunnel\"  # \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u043a wstunnel WS_URL=\"ws:\/\/127.0.0.5:5453\"            # URL \u0434\u043b\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u044f RESTRICT_PATH_PREFIX=\"wss-secretpath2\"  # \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0443\u0442\u044c \u0434\u043b\u044f --restrict-http-upgrade-path-prefix PING_TARGET=\"127.0.0.5\"                 # \u0426\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0438\u043d\u0433\u0430 CHECK_PORT=5453                         # \u041f\u043e\u0440\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 CHECK_INTERVAL=10                       # \u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 Restrict_TO=\"127.0.0.53:53\"             # \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 DNS \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 wstunnel start_tunnel() {     echo \"\u0417\u0430\u043f\u0443\u0441\u043a wstunnel...\"     $WSTUNNEL_PATH server $WS_URL --restrict-http-upgrade-path-prefix $RESTRICT_PATH_PREFIX --restrict-to $Restrict_TO &amp;    TUNNEL_PID=$! }  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f check_tunnel() {     while true; do         # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u0440\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e netcat         if ! nc -z $PING_TARGET $CHECK_PORT; then             echo \"\u0422\u0443\u043d\u043d\u0435\u043b\u044c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a...\"             kill $TUNNEL_PID             start_tunnel         fi         sleep $CHECK_INTERVAL     done } # \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 start_tunnel check_tunnel<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0442\u043e\u0436\u0435 \u0447\u0442\u043e \u0438 \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c <code>socks.sh<\/code> \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0438 \u0434\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0438\u043c\u0435\u043d\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c systemd-\u044e\u043d\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<br \/><code>sudo nano \/etc\/systemd\/system\/ws-socks.service<\/code> <br \/>\u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code>[Unit] Description=Start &amp; Check Wstunnel After=network.target  [Service] ExecStart=\/etc\/wstunnel\/socks.sh User=wstunnel Group=wstunnel  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418 \u0434\u043b\u044f DNS:<br \/> <code>sudo nano \/etc\/systemd\/system\/ws-dns.service<\/code> <br \/>\u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code>[Unit] Description=Start &amp; Check Wstunnel After=network.target  [Service] ExecStart=\/etc\/wstunnel\/dns.sh User=wstunnel Group=wstunnel  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<br \/> <code>sudo systemctl start ws-socks.service ws-dns.service<\/code> <br \/>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<br \/><code>sudo systemctl status ws-socks.service<br \/><\/code><br \/><code>sudo systemctl status ws-dns.service<\/code><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u0441\u0435 \u043e\u043a \u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0447\u0435\u0440\u0435\u0437  <code>htop<\/code> \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b, \u0438\u0449\u0435\u043c \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f wstunnel \u0442\u043e \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0438\u0445 \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 <code>sudo systemctl enable ws-socks.service ws-dns.service<\/code> <\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432<\/strong>, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 armdebian \u0441 systemd, \u0432\u0442\u043e\u0440\u043e\u0439 OpenWRT \u0441 init.d, \u0438 Windows.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 wstunnel \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432 etc, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0443.<\/p>\n<p>\u0414\u043b\u044f systemd, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 socks5 \u043f\u0440\u043e\u043a\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 WebSocket.<br \/>\u041a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441:<br \/><code>nano \/etc\/systemd\/system\/ws-socks.service<\/code><\/p>\n<pre><code>[Unit] Description=wstunnel service After=network.target  [Service] ExecStart=\/etc\/wstunnel\/wstunnel client --http-upgrade-path-prefix wss-secretpath1 --local-to-remote socks5:\/\/0.0.0.0:2080 wss:\/\/$\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d:443 --tls-verify-certificate --connection-min-idle 4 Restart=no User=nobody Group=nogroup  [Install] WantedBy=multi-user.targets<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 DNS \u043d\u0430 5353 \u043f\u043e\u0440\u0442\u0443 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e adguardhome <br \/><code>nano \/etc\/systemd\/system\/ws-dns.service<\/code><\/p>\n<pre><code>[Unit] Description=wstunnel service After=network.target  [Service] ExecStart=\/etc\/wstunnel\/wstunnel client --http-upgrade-path-prefix wss-secretpath2 --local-to-remote udp:\/\/5353:127.0.0.53:53 wss:\/\/$\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d:443 --tls-verify-certificate --connection-min-idle 2 Restart=no User=nobody Group=nogroup  [Install] WantedBy=multi-user.targets<\/code><\/pre>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f socks5 \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0442\u0430\u043a \u0436\u0435 \u0432 \/etc\/wstunnel<br \/><code>nano \/etc\/wstunnel\/chk-socks.sh<\/code><\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 TARGET=127.0.0.1 PORT=2080 SERVICE=ws-socks.service  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0440\u0442\u0430 if nc -z $TARGET $PORT; then     # \u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c     echo \"\u041f\u043e\u0440\u0442 $PORT \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.\" else     # \u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u0443     echo \"\u041f\u043e\u0440\u0442 $PORT \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0443\u0436\u0431\u044b wstunnel\"     systemctl restart $SERVICE fi <\/code><\/pre>\n<p>\u0418 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f dns<br \/><code>nano \/etc\/wstunnel\/chk-dns.sh<\/code><\/p>\n<pre><code class=\"bash\">#!\/bin\/bash # \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 TARGET=127.0.0.1 PORT=5353 SERVICE=ws-dns.service  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0440\u0442\u0430 if nc -z $TARGET $PORT; then     # \u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u043c     echo \"\u041f\u043e\u0440\u0442 $PORT \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.\" else     # \u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u0443     echo \"\u041f\u043e\u0440\u0442 $PORT \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0443\u0436\u0431\u044b wstunnel\"     systemctl restart $SERVICE fi<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u043d\u0430\u0448\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 Crontab \u043e\u0442 root: \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c<br \/><code>sudo crontab -e<br \/><\/code>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0435\u0446:<br \/><code>*\/5 * * * * \/etc\/wstunnel\/chk-dns.sh<br \/>*\/5 * * * * \/etc\/wstunnel\/chk-socks.sh<\/code><\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f OpenWRT, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0437\u043d\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430<br \/>\u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>opkg print-architecture <\/code> \u0443 \u043c\u043e\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 aarch64_cortex-a53<br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c Wstunnel \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<br \/>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 tmp:<br \/><code>cd \/tmp<\/code><br \/>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c:<br \/><code>wget https:\/\/github.com\/erebe\/wstunnel\/releases\/download\/v10.1.8\/wstunnel_10.1.8_linux_arm64.tar.gz<\/code> <br \/>\u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c:<br \/><code>tar -xvf wstunnel_10.1.8_linux_arm64.tar.gz<\/code> <br \/>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043c wstunnel:<br \/><code>mv wstunnel \/usr\/local\/bin\/wstunnel<\/code><br \/>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c:<br \/><code>chown +x \/usr\/local\/bin\/wstunnel<\/code> <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n<p><code>vi \/etc\/init.d\/ws-socks<\/code> <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh \/etc\/rc.common  # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0438\u043c\u044f \u0441\u043b\u0443\u0436\u0431\u044b START=99 STOP=10 SERVICE_NAME=\"wstunnel socks5\"  # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 start() {     echo \"Starting $SERVICE_NAME...\"     \/usr\/local\/bin\/wstunnel client --http-upgrade-path-prefix wss-secretpath1 --local-to-remote socks5:\/\/0.0.0.0:2080 wss:\/\/$\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d:443 --tls-verify-certificate --connection-min-idle 4 &amp;     echo $! &gt; \/var\/run\/$SERVICE_NAME.pid }  stop() {     echo \"Stopping $SERVICE_NAME...\"     if [ -f \/var\/run\/$SERVICE_NAME.pid ]; then         kill $(cat \/var\/run\/$SERVICE_NAME.pid)         rm \/var\/run\/$SERVICE_NAME.pid     else         echo \"$SERVICE_NAME is not running.\"     fi } <\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e dns \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <br \/><code>vi \/etc\/init.d\/ws-dns<\/code> <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh \/etc\/rc.common  # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0438\u043c\u044f \u0441\u043b\u0443\u0436\u0431\u044b START=99 STOP=10 SERVICE_NAME=\"wstunnel dns\"  # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 start() {     echo \"Starting $SERVICE_NAME...\"     \/usr\/local\/bin\/wstunnel client --http-upgrade-path-prefix wss-secretpath2 --local-to-remote udp:\/\/5353:127.0.0.53:53 wss:\/\/$\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d:443 --tls-verify-certificate --connection-min-idle 2 &amp;     echo $! &gt; \/var\/run\/$SERVICE_NAME.pid }  stop() {     echo \"Stopping $SERVICE_NAME...\"     if [ -f \/var\/run\/$SERVICE_NAME.pid ]; then         kill $(cat \/var\/run\/$SERVICE_NAME.pid)         rm \/var\/run\/$SERVICE_NAME.pid     else         echo \"$SERVICE_NAME is not running.\"     fi }<\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c: <br \/><code>chmod +x \/etc\/init.d\/ws-dns<\/code> <br \/><code>chmod +x \/etc\/init.d\/ws-socks<\/code><br \/>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c:<br \/><code>\/etc\/init.d\/ws-socks start<br \/>\/etc\/init.d\/ws-dns start<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:<br \/><code>\/etc\/init.d\/ws-socks enable<br \/>\/etc\/init.d\/ws-dns enable<\/code> <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c socks5 \u043f\u0440\u043e\u043a\u0441\u0438 \u0447\u0435\u0440\u0435\u0437 wstunnel \u0441\u043a\u0440\u044b\u0442\u044b\u0439 \u0437\u0430 haproxy \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0434\u043b\u044f VPN, \u0434\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u0435\u0447\u043d\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/habr.com\/ru\/articles\/767464\/\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043e\u0442 itdog <\/a>\u0434\u043b\u044f \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c tun2socks \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 ip \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430) \u043f\u043e\u0440\u0442 2080 \u0433\u0434\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 wstunnel \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c, \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 adguardhome \u0438\u043b\u0438 dnsmasq \u043c\u043e\u0436\u0435\u0442\u0435 \u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 127.0.0.1:5353  \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u043c \u043d\u0430\u0448\u0438 DNS \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044b. <\/p>\n<p>\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f Windows \u0442\u0430\u043a \u0436\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 start, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<br \/><code>wstunnel client --http-upgrade-path-prefix wss-secretpath1 --local-to-remote socks5:\/\/0.0.0.0:2080 wss:\/\/$\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d:443 --tls-verify-certificate --connection-min-idle 4<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0435\u0433\u043e \u043a\u0430\u043a start.cmd, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 socks5 \u043f\u0440\u043e\u043a\u0441\u0438, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f nekobox \u0441 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0430\u0448 socks5 \u043a \u043d\u0435\u043c\u0443. <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 wstunnel \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u043b\u0430\u0433 &#8212;tls-verify-certificate \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0443 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u043c\u0443.<\/p>\n<p><strong>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 VPN<br \/><\/strong><br \/>\u0414\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c VLESS + TLS <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/alireza0\/x-ui\" rel=\"noopener noreferrer nofollow\">X-UI<\/a>:<\/p>\n<pre><code>\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b VLESS \u041f\u043e\u0440\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 4444 (\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439) \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 TCP \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c PROXY Protocol \u0438 External Proxy: \u0414\u043b\u044f External Proxy: \u0422\u043e\u0442 \u0436\u0435  $\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d(\u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f VLESS) 443 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c TLS  SNI $\u0432\u0430\u0448.\u0434\u043e\u043c\u0435\u043d(\u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f VLESS) Cipher Suites  Auto Min\/Max Version  1.2 1.3 \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442  \u0434\u043e\u043b\u0436\u0435\u043d \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 .\/x-ui\/cert \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \/root\/cert\/fullchain.pem \u041a\u043b\u044e\u0447 \/root\/cert\/privkey.pem<\/code><\/pre>\n<p>\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b \u0446\u0435\u043b\u044b\u0439 \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0430\u043d\u0435\u043b\u0435\u0439 \u0434\u043b\u044f VLESS \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/habr.com\/ru\/articles\/735536\/\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442<\/a>.<\/p>\n<p>\u0412\u043e\u0442 \u043c\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 docker compose \u0444\u0430\u0439\u043b\u0430, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u0435\u0442\u044c host \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c nat \u0434\u043e\u043a\u0435\u0440\u0430:<\/p>\n<pre><code class=\"yaml\">--- services:   xui:     image: alireza7\/x-ui     container_name: x-ui     hostname: $yourhostname     volumes:       - $PWD\/db\/:\/etc\/x-ui\/       - $PWD\/cert\/:\/root\/cert\/     environment:       XRAY_VMESS_AEAD_FORCED: \"false\"     tty: true     network_mode: host     restart: unless-stopped<\/code><\/pre>\n<p>\u0415\u0449\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0430\u0439\u0442 \u0435\u0449\u0435 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c? <br \/>\u0420\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0441\u0430\u0439\u0442 \u043d\u0430 apache2 \u0438\u043b\u0438 nginx \u043d\u0430 localhost \u0438 \u043b\u044e\u0431\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u043c \u043f\u043e\u0440\u0442\u0435<br \/>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 Haproxy <br \/><code>sudo nano \/etc\/haproxy\/haproxy.cfg<\/code> <br \/>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0435\u0446:<\/p>\n<pre><code>backend http_defailt         mode http         option httpchk         option forwardfor         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-request add-header X-Real-Ip %[src]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request set-header X-Forwarded-Proto http if !{ ssl_fc }         server s1 127.0.0.1:8090<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 frontend http \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u0434 use_backend:<\/p>\n<pre><code>defailt_backend http_defailt<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c haproxy <br \/><code>sudo systemctl restart haproxy<\/code> <br \/>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0432\u0432\u043e\u0434\u0438\u043c \u0432\u0430\u0448 \u0434\u043e\u043c\u0435\u043d, \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u043b\u0441\u044f \u0441\u0430\u0439\u0442 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 VPN \u0441 VLESS, WebSocket \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b VPN \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0430\u0439\u0442 \u043e\u0431\u043c\u0430\u043d\u043a\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043d\u0430\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c stunnel \u0441\u043e SNI, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 haproxy \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c \u0431\u0435\u043b\u044b\u0445 IP \u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u043b\u0438\u0441\u0442\u0430\u043c.  <\/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\/872080\/\"> https:\/\/habr.com\/ru\/articles\/872080\/<\/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>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u044f \u0431\u0443\u0434\u0443 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043b\u044f \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438.  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e VPN \u043f\u0438\u0441\u0430\u0442\u044c \u0443 \u043d\u0430\u0441 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e, \u043d\u0430\u043f\u0438\u0448\u0443 \u043f\u0440\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0432 Haproxy, \u043f\u0440\u043e VPN \u0434\u0430\u043c \u043b\u0438\u0448\u044c \u043e\u0431\u0449\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e VPS \u043d\u0430 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0438 \u0420\u0424 \u0447\u0442\u043e \u0431\u044b \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u043e\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e, \u043c\u044b \u0432\u0435\u0434\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0437\u0430\u0449\u0438\u0442\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u0442\u0430\u043a?! \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c<\/p>\n<p>1. \u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0434\u043e\u043c\u0435\u043d\u0430 (\u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u0430), \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u043e\u043c\u0435\u043d\u044b \u0445\u043e\u0441\u0442\u0435\u0440\u0430.<br \/>2. \u0421\u0430\u043c VPS (\u043b\u0443\u0447\u0448\u0435 2 \u044f\u0434\u0440\u0430) \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0442\u0435\u0441\u0442\u043e\u0432 \u043a\u0430\u043d\u0430\u043b \u0432 200\u043c\u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0442\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442 150 \u0434\u043e 190\u043c\u0431\u0438\u0442, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0432\u043e\u0436\u0443 \u043d\u0430 Ubuntu 22.04 LTS<br \/>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043e\u0442 sudo \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<br \/> <code>sudo apt update &amp;&amp; apt upgrade -y<\/code>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:    <br \/><code>sudo apt install -y haproxy netcat-traditional htop<\/code>  <\/p>\n<p>\u0424\u0430\u0435\u0440\u0432\u043e\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438? \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c<br \/><code>sudo ufw allow 22\/tcp<\/code> \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c ssh (\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438)<br \/><code>sudo ufw allow 80,443\/tcp<\/code> \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a Web \u043f\u043e\u0440\u0442\u0430\u043c<br \/>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c DH, \u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u043e \u0436\u0434\u0435\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f<br \/><code>sudo openssl dhparam -out \/etc\/haproxy\/dh4096.pem 4096<\/code> <\/p>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c Haproxy<\/p>\n<p><\/strong>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e acme.sh \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0438 deploy \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 <a href=\"https:\/\/www.haproxy.com\/blog\/haproxy-and-let-s-encrypt\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p><strong>\u0412 \u0441\u0435\u043a\u0446\u0438\u044e global<\/strong>, \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0448\u0438\u0444\u0440\u044b, \u043e\u0441\u0442\u0430\u0432\u0438\u043c TLSv1.2 \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 TLSv1.3:<\/p>\n<pre><code>global         log \/dev\/log    local0         log \/dev\/log    local1 notice         chroot \/var\/lib\/haproxy         stats socket \/var\/run\/haproxy\/admin.sock level admin mode 660          setenv ACCOUNT_THUMBPRINT '(\u0432\u0430\u0448 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 acme)'         stats timeout 30s         user    haproxy         group   haproxy         daemon         ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-bind-options prefer-client-ciphers no-tls-tickets ssl-min-ver TLSv1.2         ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-server-options no-tls-tickets ssl-min-ver TLSv1.2         ssl-dh-param-file \/etc\/haproxy\/dh4096.pem  <\/code><\/pre>\n<p><strong>\u041f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044e defaults<\/strong>, \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440 DNS \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c timeout, \u0434\u043b\u044f \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c 1 \u0447\u0430\u0441.<\/p>\n<pre><code>defaults        log global        mode http        option httplog        option dontlognull        timeout connect 20s        timeout client  20s        timeout server  20s        timeout tunnel  1h        timeout http-request 20s        errorfile 400 \/etc\/haproxy\/errors\/400.http        errorfile 403 \/etc\/haproxy\/errors\/403.http        errorfile 408 \/etc\/haproxy\/errors\/408.http        errorfile 500 \/etc\/haproxy\/errors\/500.http        errorfile 502 \/etc\/haproxy\/errors\/502.http        errorfile 503 \/etc\/haproxy\/errors\/503.http        errorfile 504 \/etc\/haproxy\/errors\/504.http resolvers dnsserver         nameserver ns1 127.0.0.53:53         parse-resolv-conf         resolve_retries       3         timeout resolve       1s         timeout retry         1s         hold other           30s         hold refused         30s         hold nx              30s         hold timeout         30s         hold valid           10s         hold obsolete        30s frontend stats         mode http         bind 127.0.0.1:58080         stats enable         stats uri \/stats         stats realm Haproxy\\ Statistics         stats refresh 10s         stats auth user:password         stats show-legends         stats hide-version<\/code><\/pre>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c TCP frontend<\/strong>, \u043f\u0440\u0430\u0432\u0438\u043b\u0430 acl \u0438 backend  \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 http frontend \u0438 vless<\/p>\n<pre><code>frontend tcp         bind *:80,*:443         mode tcp         option tcplog         tcp-request inspect-delay 10s         tcp-request content capture req.ssl_sni len 10         tcp-request content accept if { req_ssl_hello_type 1 } or !{ req_ssl_hello_type 1 }         use_backend vless if { req.ssl_sni -i api-app.$\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d }          use_backend tcp_to_http if { dst_port 80 } #redirect https         default_backend tcp_to_https # \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043d\u0430 frontend http  #        use_backend ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 } or !{ req.ssl_hello_type 1 } { req.len 0 }  backend tcp_to_http         mode tcp         server http 127.0.0.1:8080 send-proxy-v2-ssl-cn backend tcp_to_https         mode tcp         timeout tunnel 1h         timeout client 50s         timeout server 50s         server https 127.0.0.1:8443 send-proxy-v2-ssl-cn backend vless #x-ui         mode tcp         timeout tunnel 2h         balance roundrobin         server s1 127.0.0.1:4444 check send-proxy #backend ssh #        mode tcp #        timeout tunnel 2h #        balance roundrobin #        server s1 127.0.0.1:22 check <\/code><\/pre>\n<p>\u0421\u043b\u0443\u0448\u0430\u0435\u043c 80 \u0438 443 \u043f\u043e\u0440\u0442 \u0432 tcp \u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c SNI, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 SNI \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 http frontend.<\/p>\n<p>\u0412\u0441\u0435 \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u043d\u0430 80 \u043f\u043e\u0440\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 backend tcp_to_http \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u043d\u0430 https \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 http frontend, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c proxy protocol v2 ssl cn \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043d\u0430 frontend.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c use_backend ssh \u0438 backend ssh \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 ssh \u043d\u0430 443 \u043f\u043e\u0440\u0442\u0443. <\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0435\u043a\u0446\u0438\u044f frontend http:<\/strong> <\/p>\n<pre><code>frontend https         bind 127.0.0.1:8080 accept-proxy         bind 127.0.0.1:8443 accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 strict-sni         http-request deny if { req.hdr(user-agent) -m len le 32 }         http-request deny if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. }         http-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains; preload;\"         redirect scheme https if !{ ssl_fc }         http-request return status 200 content-type text\/plain lf-string \"%[path,field(-1,\/)].${ACCOUNT_THUMBPRINT}\\n\" if { path_beg '\/.well-known\/acme-challenge\/' } #\u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c haproxy \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b LE         use_backend wstunnel1 if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path \/wss-secretpath1 } || { path_beg \/wss-secretpath1\/ }         use_backend wstunnel2 if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path \/wss-secretpath2 } || { path_beg \/wss-secretpath2\/ }          use_backend http_xui if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path_beg \/xui-secretpath\/ } || { path_beg \/xui-secretpath }          use_backend http_stats if { ssl_fc_sni -i $\u0432\u0430\u0448\u0434\u043e\u043c\u0435\u043d } { path_beg \/stats-secretpath\/ }<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043d\u0430\u0448 http \u0444\u0440\u043e\u043d\u0442\u0435\u0434 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u0442\u0430\u0445 8080 \u0438 8443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c http \u043d\u0430 https \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS \u0447\u0442\u043e \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e https.<\/p>\n<p><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c acl:<\/strong><br \/><code>use_backend wstunnel<\/code> \u0438 \u043d\u043e\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u043a\u0430\u043a \u0437\u0430 WebSocket, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043b-\u0432\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 wstunnel.<\/p>\n<p><code>use_backend http_xui<\/code> \u0442\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e xui \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 54321 \u0442\u0443\u0434\u0430 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u043c.<\/p>\n<p><code>use_backend http_stats<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 defaults, \u0441 \u043b\u043e\u0433\u0438\u043d\u043e\u043c \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c user:password (\u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c?)<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 <code>path_beg<\/code> \u0438 <code>path<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0438, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432 x-ui \u043f\u0443\u0442\u044c, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 <code>default_backend http_xui<\/code> \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u043e\u0440\u0442, <code>ufw allow 54321\/tcp<\/code> \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u0430\u043a \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0432 allow \u043d\u0430 deny. <\/p>\n<p><strong>\u0421\u0435\u043a\u0446\u0438\u044f backend http:<\/strong><\/p>\n<pre><code>backend wstunnel1         mode http         option http-keep-alive         timeout connect 30s         timeout http-keep-alive 30s         timeout client 50s         timeout server 50s         timeout tunnel 4h         balance roundrobin         server s1 127.0.0.5:54443 backend wstunnel2         mode http         option http-keep-alive         timeout connect 30s         timeout http-keep-alive 30s         timeout client 50s         timeout server 50s         #option http-server-close         timeout tunnel 4h         balance roundrobin         server s1 127.0.0.5:5453  backend http_xui         mode http         option httpchk         option forwardfor         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-request add-header X-Real-Ip %[src]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request set-header X-Forwarded-Proto http if !{ ssl_fc }         server x-ui 127.0.0.1:54321 backend http_stats         mode http         http-request replace-path \/stats-secretpath(\/)?(.*) \/\\2         server stats 127.0.0.1:58080 <\/code><\/pre>\n<p><code>backend wstunnel<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 WebSocket, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u0434\u0432\u0430.<\/p>\n<p><code>backend http_xui<\/code> \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u0435\u0431 \u043f\u0430\u043d\u0435\u043b\u044c x-ui.<\/p>\n<p><code>http_stats<\/code> \u0437\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0444\u0438\u0433 haproxy \u0433\u043e\u0442\u043e\u0432, \u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b (\u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b) \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0431\u0435\u043a\u0435\u043d\u0434\u043e\u0432.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/github.com\/erebe\/wstunnel\" rel=\"noopener noreferrer nofollow\">wstunnel \u043e\u0442 erebe<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u0447\u0435\u0440\u0435\u0437 websocket, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u0449\u0438\u0439 socks5 \u043f\u0440\u043e\u043a\u0441\u0438, \u043b\u0438\u0431\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435:<br \/>\u0411\u0435\u0440\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b release \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f 10.1.8.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432 etc:<br \/> <code>sudo mkdir \/etc\/wstunnel<\/code> <br \/>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u043d\u0435\u0435: <br \/><code>sudo cd \/etc\/wstunnel<\/code> <br \/>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0440\u0435\u043b\u0438\u0437 wstunnel:<br \/> <code>wget https:\/\/github.com\/erebe\/wstunnel\/releases\/download\/v10.1.8\/wstunnel_10.1.8_linux_amd64.tar.gz<\/code> <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 wstunnel:<br \/><code>sudo adduser --system wstunnel<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0433\u0440\u0443\u043f\u043f\u0443:<br \/><code>sudo addgroup wstunnel<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443:<br \/><code>sudo usermod -aG wstunnel wstunnel<\/code><\/p>\n<p>\u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c <code>tar -xvf wstunnel_10.1.8_linux_amd64.tar.gz<\/code> <br \/>\u0423 \u043d\u0430\u0441 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0444\u0430\u0439\u043b \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b wstunnel, \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <br \/><code>sudo chown wstunnel:wstunnel .\/wstunnel<\/code><br \/> \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e <\/p>\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-444320","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444320","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=444320"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444320\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}