Debian系统 xray 配置和使用
执行文件位置 /usr/local/bin/xray/xray
配置文件默认位置 /usr/local/etc/xray/config.json
{
"inbounds": [
{
"port": 10808,
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true,
"ip": "127.0.0.1"
}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "xx.xx.xx.xx",
"port": 42043,
"users": [
{
"id": "fa005849-8be4-428e-bedb-bc3ece0d1892",
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "none"
}
},
{
"protocol": "freedom",
"tag": "direct",
"settings": {}
}
]
}
启动命令:
/usr/local/bin/xray/xray -config /usr/local/etc/xray/config.json
自启动
[Unit] Description=Xray Service After=network.target [Service] ExecStart=/usr/local/bin/xray/xray run -config /usr/local/etc/xray/config.json Restart=on-failure [Install] WantedBy=multi-user.target
测试
curl -x socks5h://127.0.0.1:1080 https://www.google.com -I
使用
curl -x socks5h://127.0.0.1:10808 -LO https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip