V2RAY使用方法备忘
最后更新于
"dns": {
"servers": [
"114.114.114.114",
{
"address": "1.1.1.1",
"port": 53,
"domains": [
"geosite:geolocation-!cn"
]
}
]
},{
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true,
"userLevel": 8
},
"sniffing": {
"destOverride": [
"http",
"tls"
],
"enabled": true
},
"tag": "socksxxx"
},{
"listen": "127.0.0.1",
"port": 10809,
"protocol": "http",
"settings": {
"userLevel": 8
},
"tag": "httpxxx"
}{
"port": 3238,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "a83baffa-2c05-4bd9-8d86-10c7e278997a",
"security": "auto",
"level": 0
}
]
},
"tag": "v2ray"
}{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "域名或者IP",
"port": 12345,
"users": [
{
"id": "a83baffa-2c05-4bd9-8d86-10c7e278997a",
"security": "auto",
"level": 0
}
]
}
]
},
"tag": "aaa"
}{
"port": 12345,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "a83baffa-2c05-4bd9-8d86-10c7e278997a",
"security": "auto",
"level": 0
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/data" // Need to match the config in nginx
}
}
},server {
listen 80;
server_name vr.xxxx.com; # 需要配置
return 302 https://$server_name$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate /xxxxx/fullchain.cer; # 需要配置
ssl_certificate_key //xxxxx/xxxx.key; # 需要配置
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
root /path/to/a/static/website; # 需要配置
server_name vr.xxxx.com; # 需要配置
location /data { # 需要配置
proxy_redirect off;
proxy_pass http://v2ray-server-local:12345; # 需要配置
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "域名或者IP",
"port": 12345,
"users": [
{
"id": "a83baffa-2c05-4bd9-8d86-10c7e278997a",
"security": "auto",
"level": 0
}
]
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"wsSettings": {
"path": "/data"
}
},
"tag": "aaa"
}{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{//连接家里局域网的,走代理,可删除
"type": "field",
"ip": [
"192.168.1.0/24"
],
"outboundTag": "aaa"
},
{//直连中国域名
"type": "field",
"outboundTag": "direct",
"domain": [
"geosite:cn"
]
},
{//其它的中国IP和私有IP都直连
"type": "field",
"outboundTag": "direct",
"ip": [
"geoip:cn",
"geoip:private"
]
},
// TODO 可以增加更多配置
{//直接连接到世界的互联网
"type": "field",
// "balancerTag": "blancerxxx",
"outboundTag": "aaa",
"network": "tcp,udp"
}
],
"balancers": [//可配置负载均衡
{
"tag": "blancerxxx",
"selector": [
"aaa",
"bbb"
],
"strategy": {
"type": "random"
}
}
]
}