Open dalaolala opened 3 years ago
如果使用v2ray协议,则使用如下的配置
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 9000,
"listen": "127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "eb950add-608e-409d-937f-e797324387098b",
"level": 1,
"alterId": 0
}
]
},
"streamSettings":{
"network": "ws",
"wsSettings": {
"path": "/api"
}
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}
环境变量名不宜为 v2ray.vmess.aead.forced
,v2ray_vmess_aead_forced
解决
alterId都设置0就好了
参考
https://github.com/Jrohy/multi-v2ray/issues/561
一键脚本参考
location /api {
proxy_redirect off;
proxy_pass http://127.0.0.1:9000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
配置来自chatpgt =-=
{
"inbounds": [
{
"port": 11112, //监听端口
"protocol": "vmess", //协议类型
"settings": {
"clients": [
{
"id": "8ef39e0e-3709-47fa-85b5-aadf69906cc9", //客户端UUID
"alterId": 0
}
]
},
"streamSettings": {
"network": "tcp", //底层传输协议
"tcpSettings": {
"header": {
"type": "http", //TCP头部类型,可选 http 或 srtp
"request": {
"version": "1.1",
"method": "GET",
"path": ["/go"],
"headers": {
"Host": ["download.windowsupdate.com"],
"User-Agent": ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"]
}
},
"response": {
"version": "1.1",
"status": "200",
"reason": "OK",
"headers": {
"Content-Type": ["application/octet-stream"],
"Transfer-Encoding": ["chunked"],
"Connection": ["keep-alive"],
"Pragma": "no-cache"
}
}
}
}
},
"sniffing": {
"enabled": true, //是否开启流量探测
"destOverride": ["http", "tls"] //探测目的地
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
官方安装参考这里 https://github.com/v2fly/fhs-install-v2ray
安装curl
下载脚本执行
国内服务器执行
获取一个新的uuid https://1024tools.com/uuid 复制其中一行 uuid
进入 /usr/local/etc/v2ray/ 目录,编辑 config.json 文件 将里面全部代码改为: