注意是客户端不是服务端哦,这里的场景是,已经有台境外VPS作为服务端了,要给国内的CentOS挂上那玩意,所以给国内的CentOS装V2Ray作为客户端。 看了一圈,给Linux装V2rRay的基本上都是用LInux做服务器,没有找到有参考价值的客户端配置文件,所以记录于此,作为备忘也作为分享。
config.json:
{
"log": {
"access": "",
"error": "",
"loglevel": "warning"
},
"inbounds": [
{
"tag": "socks",
"port": 1080,//①客户端的运行端口,不是服务器的运行端口
"listen": "127.0.0.1",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth",
"udp": true,
"allowTransparent": false
}
},
{
"tag": "http",
"port": 10809,
"listen": "127.0.0.1",
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"udp": false,
"allowTransparent": false
}
}
],
"outbounds": [
{
"tag": "proxy",
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "45.156.24.89",②VPS的IP地址
"port": 8888,③VPS服务器的运行端口
"users": [
{
"id": "e295ad63-513a-省略-bf42-afa77eaad23a",④唯一的id,与vps端配置文件需保持一致
"alterId": 0,⑤需要和服务端配置文件保持一致
"email": "t@t.tt",
"security": "auto"⑥加密方式
}
]
}
]
},
"streamSettings": {
"network": "tcp"
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
}
}
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "linear",
"rules": [
{
"type": "field",
"inboundTag": [
"api"
],
"outboundTag": "api",
"enabled": true
},
{
"type": "field",
"port": "0-65535",
"outboundTag": "proxy",
"enabled": true
}
]
}
}
配置并启动V2ray之后,终端下输入该命令: curl -x socks5://127.0.0.1:10808 https://www.google.com -v 如果daili成功,则会返回google.com的源代码,否则会显示啥啥啥refused
|