配置一:
TCP模式,服务器禁止代理私有地址,客户机私有地址不走代理:
服务端:
{
"inbounds": [
{
"port": ****,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "********-****-****-****-************",
"alterId": 32
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp"
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"ip": [
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
],
"outboundTag": "blocked"
}
]
}
}
客户端:
{
"inbounds": [
{
"listen": "127.0.0.1",
"port": "1080",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true
}
},
{
"listen": "127.0.0.1",
"port": "1081",
"protocol": "http",
"settings": {
"auth": "noauth",
"udp": true
}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "***.***.***.***",
"port": ****,
"users": [
{
"id": "********-****-****-****-************",
"alterId": 32,
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "none",
"tcpSettings": {}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
}
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"port": null,
"inboundTag": null,
"outboundTag": "direct",
"ip": [
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
],
"domain": null
}
]
}
}
配置二:
websockets模式,代理全部链接(包括私有地址),NGINX反代HTTPS:
服务器配置:
{
"inbounds": [
{
"port": 1080,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "********-****-****-****-************",
"alterId": 32
}
],
"decryption": "none"
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"path": "/v2ray"
}
},
"listen": "127.0.0.1"
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom"
}
]
}
NGINX配置(仅虚拟目录部分):
location /v2ray {
proxy_redirect off;
proxy_pass http://127.0.0.1:1080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 300s;
}
客户机配置:
{
"inbounds": [
{
"listen": "127.0.0.1",
"port": "1088",
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "****.com",
"port": ****,
"users": [
{
"id": "********-****-****-****-************",
"alterId": 32,
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"wsSettings": {
"path": "/v2ray"
},
"tlsSettings": {
"serverName": "****.com"
}
}
}
]
}