Skip to content

Instantly share code, notes, and snippets.

@AlekseiOvchinnikov13
Last active February 22, 2024 08:41
Show Gist options
  • Save AlekseiOvchinnikov13/f421e8d72f95740494517a1861a39f51 to your computer and use it in GitHub Desktop.
Save AlekseiOvchinnikov13/f421e8d72f95740494517a1861a39f51 to your computer and use it in GitHub Desktop.
Proxy setup
source https://habr.com/ru/articles/731608/
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.1/Xray-linux-64.zip
mkdir /opt/xray
unzip ./Xray-linux-64.zip -d /opt/xray
chmod +x /opt/xray/xray
nano /usr/lib/systemd/system/xray.service
# (пример ниже)
systemctl enable xray
# сохранить вывод команд
/opt/xray/xray uuid
/opt/xray/xray x25519
# shortID можно сгенерить openssl rand -hex 8, но автор ставит aabbccdd
(сработало только как у автора, если сработает сгенерированный, дайте знать)
nano /opt/xray/config.json
# (пример ниже)
systemctl restart xray
journalctl -u xray -f
# установка клиентов
https://github.com/MatsuriDayo/nekoray/releases для ПК и MacOS
https://apps.apple.com/app/id6448898396 для IOS
# нюанс для ПК
1. нужно переключиться на использование движка sing-box
2. после добавления профиля открываем от админа и ставим галочки "Режим тунеля" и "Режим системного прокси"
{
"log": {
"loglevel": "info"
},
"routing": {
"rules": [],
"domainStrategy": "AsIs"
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"tag": "vless_tls",
"settings": {
"clients": [
{
"id": "<your uuid>",
"email": "<your email>",
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false,
"dest": "www.microsoft.com:443",
"xver": 0,
"serverNames": [
"www.microsoft.com"
],
"privateKey": "<your private key>",
"minClientVer": "",
"maxClientVer": "",
"maxTimeDiff": 0,
"shortIds": [
"aabbccdd"
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
]
}
[Unit]
Description=Xray Service
Documentation=https://github.com/xtls
After=network.target nss-lookup.target
[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ExecStart=/opt/xray/xray run -config /opt/xray/config.json
Restart=on-failure
RestartPreventExitStatus=23
LimitNPROC=10000
LimitNOFILE=1000000
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment