User Tools

Site Tools


wiki:welcome

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:welcome [2019/12/01 22:30] – created - external edit 127.0.0.1wiki:welcome [2026/11/18 15:00] (current) – bopsi
Line 1: Line 1:
-====== Welcome to your new DokuWiki ======+~~TOC~~
  
-Congratulations, your wiki is now up and running. Here are a few more tips to get you started.+Это мой гайд по настройке [[https://github.com/SagerNet/sing-box|sing-box]] для обхода блокировок. Много чего взял [[https://gist.github.com/swrneko/09e60de4d3d8f9a551a1a2c1ab9283c5|отсюда]].
  
-Enjoy your work with DokuWiki,\\ +====== Поддерживаемые протоколы ====== 
--- the developers+  * [[https://github.com/klzgrad/naiveproxy|NaiveProxy]] 
 +  * [[https://github.com/trojan-gfw/trojan|Trojan]] 
 +  * [[https://xtls.github.io/ru/development/protocols/vless.html|VLESS]] + [[https://xtls.github.io/ru/config/transports/reality.html|Reality]] 
 +  * [[https://v2.hysteria.network|Hysteria2]] 
 +  * [[https://github.com/anytls/anytls-go|AnyTLS]] 
 +  * [[https://github.com/tuic-protocol/tuic|TUIC]] 
 +  * [[https://github.com/shadowsocks/shadowsocks-rust|Shadowsocks]] + [[https://github.com/ihciah/shadow-tls|ShadowTLS]] 
 +  * [[https://datatracker.ietf.org/doc/html/rfc9484|MASQUE]]
  
-===== Create your first pages =====+====== Подготовка ====== 
 +Требуется VPS с дистрибутивом на базе systemd (например, Debian).
  
-Your wiki needs to have a start page. As long as it doesn't exist, this link will be red: [[:start]].+Установите ваш редактор по умолчанию (например, vim или nano): 
 +<code bash> 
 +sudo update-alternatives --config editor 
 +</code>
  
-Go on, follow that link and create the page. If you need help with using the syntax you can always refer to the [[wiki:syntax|syntax page]].+Включаем BBR: 
 +<code bash> 
 +echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf 
 +echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf 
 +echo "net.ipv4.tcp_slow_start_after_idle=0" | sudo tee -a /etc/sysctl.conf # Уменьшает количество подлагиваний 
 +echo "net.ipv4.tcp_notsent_lowat=131072" | sudo tee -a /etc/sysctl.conf # Лимит на объем неотправленных данных 
 +sudo sysctl -p 
 +</code>
  
-You might also want to use a sidebar. To create it, just edit the [[:sidebar]] page. Everything in that page will be shown in a margin column on the side. Read our [[doku>faq:sidebar|FAQ on sidebars]] to learn more.+====== Установка NaiveProxy на сервер ====== 
 +Ставим Go: 
 +<code bash> 
 +export GO_VER=$(curl --silent "https://go.dev/VERSION?m=text" | head -n 1) 
 +wget https://go.dev/dl/$GO_VER.linux-amd64.tar.gz 
 +sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf $GO_VER.linux-amd64.tar.gz && rm -rf $GO_VER.linux-amd64.tar.gz 
 +echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile 
 +source ~/.profile 
 +</code>
  
-Please be aware that not all templates support sidebars.+Устанавливаем XCaddy, чтобы собрать Caddy с плагином от автора NaiveProxy: 
 +<code bash> 
 +go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest 
 +</code>
  
-===== Customize your Wiki =====+Собираем Caddy с нужным нам плагином: 
 +<code bash> 
 +export CADDY_VERSION=master 
 +~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive 
 +sudo mv caddy /usr/bin/caddy 
 +sudo chmod +x /usr/bin/caddy 
 +</code>
  
-Once you're comfortable with creating and editing pages you might want to have a look at the [[this>doku.php?do=admin&page=config|configuration settings]] (be sure to login as superuser first).+Создаём папку Caddy и редактируем конфиг (нужен свой домен, зарегистрированный на IP-адрес сервера, но можно зарегистрировать бесплатный на FreeDNS или DuckDNS): 
 +<code bash> 
 +sudo mkdir /etc/caddy 
 +sudo touch /etc/caddy/Caddyfile 
 +sudoedit /etc/caddy/Caddyfile 
 +</code>
  
-You may also want to see what [[doku>plugins|plugins]] and [[doku>templates|templates]] are available at DokuWiki.org to extend the functionality and looks of your DokuWiki installation.+Вставляем такое содержимое (замените `example.com`, `email`, `user` и `pass` на ваши): 
 +<code caddyfile> 
 +{ 
 +   order forward_proxy before file_server 
 +   log { 
 +     exclude http.log.error 
 +     output file /var/log/caddy/access.log { 
 +       roll_size 10mb 
 +     } 
 +   } 
 +} 
 +:443, example.com { # Ваш домен 
 +   tls email@example.com # Почта, с которой регистрировали домен 
 +   encode 
 +   forward_proxy { 
 +     basic_auth user pass # Логин и пароль (лучше сгенерировать через openssl rand -hex 8) 
 +     hide_ip 
 +     hide_via 
 +     probe_resistance 
 +   } 
 +   file_server { 
 +     root /var/www/html 
 +   } 
 +} 
 +</code>
  
-===== Join the Community =====+Создаём systemd-юнит для автозагрузки Caddy: 
 +<code bash> 
 +sudo cat <<EOF > /etc/systemd/system/caddy.service 
 +[Unit] 
 +Description=Caddy 
 +Documentation=https://caddyserver.com/docs/ 
 +After=network.target network-online.target 
 +Requires=network-online.target
  
-DokuWiki is an Open Source project that thrives through user contributions. A good way to stay informed on what's going on and to get useful tips in using DokuWiki is subscribing to the [[doku>newsletter]].+[Service] 
 +User=root 
 +Group=root 
 +ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile 
 +ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile 
 +TimeoutStopSec=5s 
 +LimitNOFILE=1048576 
 +LimitNPROC=512 
 +PrivateTmp=true 
 +ProtectSystem=full 
 +AmbientCapabilities=CAP_NET_BIND_SERVICE
  
-The [[https://forum.dokuwiki.org|DokuWiki User Forum]] is an excellent way to get in contact with other DokuWiki users and is just one of the many ways to get [[doku>faq:support|support]].+[Install] 
 +WantedBy=multi-user.target 
 +EOF 
 +</code>
  
-Of course we'd be more than happy to have you [[doku>teams:getting_involved|getting involved]] with DokuWiki.+Включаем Caddy: 
 +<code bash> 
 +sudo systemctl daemon-reload 
 +sudo caddy fmt --overwrite /etc/caddy/Caddyfile 
 +sudo systemctl enable --now caddy 
 +</code> 
 + 
 +====== Установка Hysteria2 на сервер ====== 
 +Устанавливаем Hysteria2: 
 +<code bash> 
 +bash <(curl -fsSL https://get.hy2.sh/) 
 +</code> 
 + 
 +Редактируем конфиг для Hy2: 
 +<code bash> 
 +sudo mkdir /etc/hysteria 
 +sudo touch /etc/hysteria/config.yaml 
 +sudoedit /etc/hysteria/config.yaml 
 +</code> 
 + 
 +И вставляем (пароли лучше сгенерировать через `openssl rand -hex 8`): 
 +<code yaml> 
 +listen: :1234 
 +acme: 
 +  domains: 
 +    - example.com # Ваш домен 
 +  email: email # Почта, с которой регистрировали домен 
 +auth: 
 +  type: password 
 +  password: hy2_pass # Пароль от Hy2 
 +obfs: 
 +  type: gecko 
 +  gecko: 
 +    password: obfs_pass # Пароль от обфускации 
 +    minPacketSize: 512   
 +    maxPacketSize: 1200   
 +masquerade: 
 +  type: proxy 
 +  proxy: 
 +    url: https://news.ycombinator.com/ 
 +    rewriteHost: true 
 +</code> 
 + 
 +Стартуем Hysteria: 
 +<code bash> 
 +sudo systemctl enable --now hysteria-server.service 
 +</code> 
 + 
 +====== Установка sing-box на сервер ====== 
 +Теперь ставим sing-box: 
 +<code bash> 
 +curl -fsSL https://sing-box.app/install.sh | sh -s -- --beta 
 +</code> 
 + 
 +Генерируем нужные значения: 
 +<code bash> 
 +sing-box generate rand --hex 8 # Имя для MASQUE 
 +sing-box generate rand --hex 8 # Пароль для MASQUE 
 +sing-box generate rand --hex 8 # Пароль для Trojan 
 +sing-box generate uuid # UUID для VLESS 
 +sing-box generate reality-keypair # Ключи для VLESS (обязательно сохраните публичный ключ) 
 +sing-box generate rand --hex 2 # Short ID для VLESS 
 +sing-box generate rand --hex 8 # Пароль для AnyTLS 
 +sing-box generate rand --hex 8 # Имя для AnyTLS 
 +sing-box generate rand --hex 8 # Имя для TUIC 
 +sing-box generate uuid # UUID для TUIC 
 +sing-box generate rand --hex 8 # Пароль от TUIC 
 +sing-box generate rand --base64 16 # Пароль для Shadowsocks 
 +sing-box generate rand --hex 8 # Имя для ShadowTLS 
 +sing-box generate rand --hex 8 # Пароль для ShadowTLS 
 +</code> 
 + 
 +Редактируем конфиг: 
 +<code bash> 
 +sudoedit /etc/sing-box/config.json 
 +</code> 
 + 
 +Вставьте следующее (если там уже что-то было, удалите): 
 +<code json> 
 +{ 
 +   "log": { 
 +     "level": "warn" 
 +   }, 
 +   "endpoints": [ 
 +     { 
 +       "type": "masque-server", 
 +       "tag": "masque-server", 
 +       "listen": "::", 
 +       "listen_port": 500, 
 +       "users": [ 
 +         { 
 +           "username": "username", 
 +           "password": "password" 
 +         } 
 +       ], 
 +       "version": 3, 
 +       "tls": { 
 +         "enabled": true, 
 +         "certificate_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.crt", 
 +         "key_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.key" 
 +       }, 
 +       "address": "10.0.0.1/24" 
 +     } 
 +   ], 
 +   "inbounds": [ 
 +     { 
 +       "type": "trojan", 
 +       "tag": "trojan-in", 
 +       "listen": "::", 
 +       "listen_port": 20808, 
 +       "users": [ 
 +         { 
 +           "password": "password" 
 +         } 
 +       ], 
 +       "tls": { 
 +         "enabled": true, 
 +         "certificate_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.crt", 
 +         "key_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.key" 
 +       }, 
 +       "fallback": { 
 +         "server": "127.0.0.1", 
 +         "server_port": 8082 
 +       }, 
 +       "fallback_for_alpn": { 
 +         "http/1.1": { 
 +           "server": "127.0.0.1", 
 +           "server_port": 8081 
 +         } 
 +       }     
 +     }, 
 +     { 
 +       "type": "vless", 
 +       "tag": "vless-in", 
 +       "listen": "::", 
 +       "listen_port": 10808, 
 +       "users": [ 
 +         { 
 +           "uuid": "uuid", 
 +           "flow": "xtls-rprx-vision" 
 +         } 
 +       ], 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "aws.amazon.com", 
 +         "reality": { 
 +           "enabled": true, 
 +           "handshake": { 
 +             "server": "aws.amazon.com", 
 +             "server_port": 443 
 +           }, 
 +           "private_key": "private_key", 
 +           "short_id": "short_id" 
 +         } 
 +       } 
 +     }, 
 +     { 
 +       "type": "anytls", 
 +       "tag": "anytls-in", 
 +       "listen": "::", 
 +       "listen_port": 8443, 
 +       "tls": { 
 +         "enabled": true, 
 +         "certificate_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.crt", 
 +         "key_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.key" 
 +       }, 
 +       "users": [ 
 +         { 
 +           "name": "name", 
 +           "password": "password" 
 +         } 
 +       ] 
 +     }, 
 +     { 
 +       "type": "tuic", 
 +       "tag": "tuic-in", 
 +       "listen": "::", 
 +       "listen_port": 8080, 
 +       "users": [ 
 +         { 
 +           "name": "name", 
 +           "uuid": "uuid", 
 +           "password": "password" 
 +         } 
 +       ], 
 +       "congestion_control": "bbr", 
 +       "tls": { 
 +         "enabled": true, 
 +         "certificate_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.crt", 
 +         "key_path": "/root/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.key" 
 +       } 
 +     }, 
 +     { 
 +       "type": "shadowsocks", 
 +       "tag": "ss-in", 
 +       "method": "2022-blake3-aes-128-gcm", 
 +       "password": "password" 
 +     }, 
 +     { 
 +       "type": "shadowtls", 
 +       "tag": "st-in", 
 +       "listen": "::", 
 +       "listen_port": 1080, 
 +       "detour": "ss-in", 
 +       "version": 3, 
 +       "users": [ 
 +         { 
 +           "name": "name", 
 +           "password": "password" 
 +         } 
 +       ], 
 +       "handshake": { 
 +         "server": "aws.amazon.com", 
 +         "server_port": 443 
 +       } 
 +     } 
 +   ], 
 +   "outbounds": [ 
 +     { 
 +       "type": "direct" 
 +     } 
 +   ] 
 +} 
 +</code> 
 + 
 +Замените `example.com` и `private_key` на ваш домен и приватный ключ. 
 + 
 +Отредактируйте systemd-юнит sing-box: 
 +<code bash> 
 +sudoedit /usr/lib/systemd/system/sing-box.service 
 +</code> 
 +Сразу после `[Service]` добавьте строку `User=root`. 
 + 
 +Включаем sing-box: 
 +<code bash> 
 +sudo systemctl daemon-reload  
 +sudo systemctl enable --now sing-box 
 +</code> 
 + 
 +Открываем все необходимые порты (команды для `ufw`): 
 +<code bash> 
 +sudo ufw enable 
 +sudo ufw allow 443  
 +sudo ufw allow 80 
 +sudo ufw allow 20808 
 +sudo ufw allow 10808 
 +sudo ufw allow 1234 
 +sudo ufw allow 8443 
 +sudo ufw allow 8080 
 +sudo ufw allow 1080 
 +sudo ufw allow 500 
 +</code> 
 + 
 +====== Установка NaiveProxy на клиент ====== 
 +Скачиваем последний релиз: 
 +<code bash> 
 +NAIVE_VER=$(curl -sL https://api.github.com/repos/klzgrad/naiveproxy/releases/latest | sed -n 's/.*"tag_name": "\([^"]*\)".*/\1/p' | head -n 1) 
 +curl -sL https://github.com/klzgrad/naiveproxy/releases/download/${NAIVE_VER}/naiveproxy-${NAIVE_VER}-linux-x64.tar.xz | tar -xJ 
 +cd naiveproxy-${NAIVE_VER}-linux-x64 
 +nano config.json 
 +</code> 
 + 
 +Редактируем: 
 +<code json> 
 +{ 
 +  "listen": [ 
 +    "socks://127.0.0.1:1080", 
 +    "http://127.0.0.1:8080" 
 +  ], 
 +  "proxy": "quic://user:pass@example.com", 
 +  "log": "" 
 +} 
 +</code> 
 +*(Примечание: `quic://` можно заменить на `https://`, если нужен HTTP/2. Замените `user`, `pass` и `example.com` на ваши данные из Caddyfile).* 
 + 
 +Запускаем: 
 +<code bash> 
 +./naive 
 +</code> 
 +Запуск поднимет SOCKS5-прокси на `127.0.0.1:1080` и HTTP на `8080`, который можно, например, подключить в Telegram. 
 + 
 +====== Установка Hysteria2 на клиент ====== 
 +Устанавливаем Hy2 (ссылку можно заменить под вашу платформу): 
 +<code bash> 
 +wget https://download.hysteria.network/app/latest/hysteria-linux-amd64 
 +</code> 
 + 
 +Создайте `config.yaml` и вставьте: 
 +<code yaml> 
 +server: IP:1234 # Замените IP на IP сервера 
 +auth: hy2_pass # Пароль от Hy2 
 +tls: 
 +  sni: example.com # Ваш домен 
 +obfs: 
 +  type: gecko 
 +  gecko: 
 +    password: obfs_pass # Пароль от обфускации 
 +    minPacketSize: 512   
 +    maxPacketSize: 1200 
 +bandwidth: # Можно менять в зависимости от скорости вашего интернета 
 +  up: 100 mbps 
 +  down: 300 mbps 
 +socks5: 
 +  listen: 127.0.0.1:2080 
 +http: 
 +  listen: 127.0.0.1:3128 
 +lazy: true 
 +</code> 
 + 
 +Запустите: 
 +<code bash> 
 +chmod +x ./hysteria-linux-amd64 
 +./hysteria-linux-amd64 
 +</code> 
 +Запуск поднимет SOCKS5-прокси на порту `2080` и HTTP на `3128`. 
 + 
 +====== Установка sing-box на клиент ====== 
 +Устанавливаем и редактируем sing-box: 
 +<code bash> 
 +curl -fsSL https://sing-box.app/install.sh | sh -s -- --beta 
 +sudoedit config.jsonc 
 +</code> 
 + 
 +Вставляем конфиг: 
 +<code json> 
 +{ 
 +   "$schema": "https://sing-box.sagernet.org/schema.json", 
 +   "log": { 
 +     "level": "debug" 
 +   }, 
 +   "dns": { 
 +     "servers": [ 
 +       { 
 +         "type": "h3", 
 +         "tag": "dns", 
 +         "detour": "selector", 
 +         "server": "1.1.1.1", 
 +         "tls": { 
 +           "server_name": "cloudflare-dns.com" 
 +         } 
 +       } 
 +     ], 
 +     "strategy": "ipv4_only" 
 +   }, 
 +   "endpoints": [ 
 +     { 
 +       "type": "masque-client", 
 +       "tag": "masque-client", 
 +       "server": "server_IP", 
 +       "server_port": 500, 
 +       "username": "username", 
 +       "password": "password", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "example.com" 
 +       }, 
 +       "version": 3, 
 +       "disable_version_fallback": true, 
 +       "on_demand": true, 
 +       "disable_path_mtu_discovery": true 
 +     } 
 +   ], 
 +   "inbounds": [ 
 +     { 
 +       "type": "tun", 
 +       "tag": "tun-in", 
 +       "interface_name": "tun0", 
 +       "mtu": 1280, 
 +       "address": "172.19.0.1/30", 
 +       "auto_route": true, 
 +       "strict_route": true, 
 +       "route_exclude_address": [ 
 +         "server_IP/32" 
 +       ], 
 +       "exclude_package": [ 
 +         "com.android.captiveportallogin", 
 +         "ru.oneme.app" 
 +       ] 
 +     } 
 +   ], 
 +   "outbounds": [ 
 +     { 
 +       "type": "naive", 
 +       "tag": "naive-out", 
 +       "server": "server_IP", 
 +       "server_port": 443, 
 +       "username": "username", 
 +       "password": "password", 
 +       "insecure_concurrency": 1, 
 +       "udp_over_tcp": true, 
 +       "quic": true, 
 +       "quic_congestion_control": "bbr", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "example.com" 
 +       } 
 +     }, 
 +     { 
 +       "type": "trojan", 
 +       "tag": "trojan-out", 
 +       "server": "server_IP", 
 +       "server_port": 20808, 
 +       "password": "password", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "example.com", 
 +         "utls": { 
 +           "enabled": true, 
 +           "fingerprint": "firefox" 
 +         } 
 +       } 
 +     }, 
 +     { 
 +       "type": "vless", 
 +       "tag": "vless-out", 
 +       "server": "server_IP", 
 +       "server_port": 10808, 
 +       "uuid": "uuid", 
 +       "flow": "xtls-rprx-vision", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "aws.amazon.com", 
 +         "utls": { 
 +           "enabled": true, 
 +           "fingerprint": "chrome" 
 +         }, 
 +         "reality": { 
 +           "enabled": true, 
 +           "public_key": "public_key", 
 +           "short_id": "short_id" 
 +         } 
 +       }, 
 +       "packet_encoding": "xudp" 
 +     }, 
 +     { 
 +       "type": "hysteria2", 
 +       "tag": "hy2-out", 
 +       "server": "server_IP", 
 +       "server_port": 1234, 
 +       "up_mbps": 100, 
 +       "down_mbps": 300, 
 +       "obfs": { 
 +         "type": "gecko", 
 +         "password": "password" 
 +       }, 
 +       "password": "password", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "example.com" 
 +       } 
 +     }, 
 +     { 
 +       "type": "anytls", 
 +       "tag": "anytls-out", 
 +       "server": "server_IP", 
 +       "server_port": 8443, 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "example.com" 
 +       }, 
 +       "password": "password", 
 +       "idle_session_check_interval": "30s", 
 +       "idle_session_timeout": "30s", 
 +       "min_idle_session": 5 
 +     }, 
 +     { 
 +       "type": "tuic", 
 +       "tag": "tuic-out", 
 +       "server": "server_IP", 
 +       "server_port": 8080, 
 +       "uuid": "uuid", 
 +       "password": "password", 
 +       "congestion_control": "bbr", 
 +       "udp_relay_mode": "native", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "example.com" 
 +       } 
 +     }, 
 +     { 
 +       "type": "shadowtls", 
 +       "tag": "st-out", 
 +       "server": "server_IP", 
 +       "server_port": 1080, 
 +       "version": 3, 
 +       "password": "password", 
 +       "tls": { 
 +         "enabled": true, 
 +         "server_name": "aws.amazon.com" 
 +       } 
 +     }, 
 +     { 
 +       "type": "shadowsocks", 
 +       "tag": "ss-out", 
 +       "detour": "st-out", 
 +       "method": "2022-blake3-aes-128-gcm", 
 +       "password": "password" 
 +     }, 
 +     { 
 +       "type": "selector", 
 +       "tag": "selector", 
 +       "outbounds": [ 
 +         "naive-out", 
 +         "trojan-out", 
 +         "vless-out", 
 +         "hy2-out", 
 +         "anytls-out", 
 +         "tuic-out", 
 +         "ss-out", 
 +         "masque-client" 
 +       ], 
 +       "default": "hy2-out" 
 +     }, 
 +     { 
 +       "type": "direct", 
 +       "tag": "direct" 
 +     } 
 +   ], 
 +   "route": { 
 +     "rules": [ 
 +       { 
 +         "action": "sniff", 
 +         "sniffer": [ 
 +           "http", 
 +           "tls", 
 +           "dns", 
 +           "quic" 
 +         ], 
 +         "timeout": "300ms" 
 +       }, 
 +       { 
 +         "protocol": "dns", 
 +         "action": "hijack-dns" 
 +       }, 
 +       { 
 +         "action": "resolve", 
 +         "server": "dns" 
 +       }, 
 +       { 
 +         "ip_is_private": true, 
 +         "outbound": "direct" 
 +       }, 
 +       { 
 +         "domain_suffix": [ 
 +           ".ru" 
 +         ], 
 +         "domain_keyword": [ 
 +           "github" 
 +         ], 
 +         "outbound": "direct" 
 +       }, 
 +       { 
 +         "process_name": [ 
 +           "ssh", 
 +           "git" 
 +         ], 
 +         "outbound": "direct" 
 +       } 
 +     ], 
 +     "final": "selector", 
 +     "auto_detect_interface": true, 
 +     "default_domain_resolver": "dns" 
 +   } 
 +} 
 +</code> 
 + 
 +Замените: 
 +  * `server_IP` на IP-адрес вашего VPS. 
 +  * `public_key` на публичный ключ, сгенерированный вместе с приватным. 
 +  * `username`, `password`, `uuid`, `short_id` на те же самые, что и на сервере. 
 +  * `example.com` на ваш домен. 
 + 
 +Запускаем: 
 +<code bash> 
 +sudo sing-box run -c ./config.jsonc 
 +</code> 
 + 
 +====== Установка на Android ====== 
 +Скачиваем `.apk`-файл с последнего [[https://github.com/SagerNet/sing-box/releases|пре-релиза]] и устанавливаем. Перекидываем конфиг на телефон и заходим в sing-box. Нажимаем на `+` и выбираем "Импорт из файла". Импортируем конфиг и подключаемся. 
 + 
 +====== Как менять протоколы ====== 
 +В блоке `selector` поменяйте значение `default` на тег какого-либо из протоколов (они перечислены в массиве `outbounds` выше). 
 + 
 +====== Альтернативные клиенты ====== 
 +  * **На Windows и Linux:** [[https://throneproj.github.io/ru/|Throne]], [[https://github.com/qr243vbi/nekobox|NekoBox]] и [[https://github.com/SagerNet/sing-box-for-desktop|Sing-box-For-Desktop]]. 
 +  * **На Android:** [[https://github.com/MatsuriDayo/NekoBoxForAndroid|NekoBox For Android]].
  
wiki/welcome.1575239402.txt.gz · Last modified: by 127.0.0.1