rogerxu 大佬有话说 : 2020-3-18 08:40:19
分享下V2RAY的config.json配置,如何只代理GITHUB
本帖最后由 rogerxu 于 2020-3-18 08:44 编辑
昨天得到大佬帮助,帮解决了github单独代理的设置问题。
后来自己再琢磨了下,现在将心得总结到这里。
{
"log": {
"loglevel": "warning",
"access": "D:\v2ray\access.log",
"error": "D:\v2ray\error.log"
},
"inbounds": [
{
"port": 1080,
"protocol": "socks",
"settings": {
"auth": "noauth"
}
"tag": "special"
}
],
"inbounds": [
{
"port": 1081,
"protocol": "socks",
"settings": {
"auth": "noauth"
}
"tag": "ladder"
}
],
"outbounds": [
{
"tag": "viaserver"
"protocol": "vmess", // 出口协议
"settings": {
"vnext": [
{
"address": "serveraddr.com", // 服务器 IP 地址
"port": 16823,// 服务器端口
"users": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811",// 用户 ID,须与服务器端配置相同
"alterId": 64
}
]
}
]
}
},
{
"tag": "direct"
"protocol": "freedom",
"settings": {}
},
{
"tag": "block"
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"rules": [
{
"domain": [
"domain:google.com",
"geosite:github"
],
"inboundTag": [
"special"
],
"outboundTag": "direct",
"type": "field"
},
{
"inboundTag": [
"ladder"
],
"outboundTag": "direct",
"type": "field"
},
]
}
}
上面的代码,
1、定义了两个入站端口,1080和1081,直接是SOCKS代理,相信VMESS协议大家都会自己配的,分别叫“spacial”和“ladder”的名字。
2、定义了三个出站端方式:direct直连,block堵塞,viaserver走另一个服务器做踏板。
3、关键是routing里面定义了对special这个入口,并且要访问的域名是google和github的,就推到direct出口。对ladder这个入口的数据全推到viaserver出口。
xiao 大佬有话说 : 2020-3-18 08:41:09
V2这辈子只会一键yc022t
我哪知道啊,紫薯布丁
rogerxu 大佬有话说 : 2020-3-18 08:41:33
本帖最后由 rogerxu 于 2020-3-18 08:44 编辑
domain:google.com这里没用geosite,因为如果用geosite就将google的所有域名包括有图比都加进去了
hasamol7468 大佬有话说 : 2020-3-18 08:41:54
本帖最后由 hasamol7468 于 2020-3-18 08:45 编辑
:lol 做路由 指定入口按路由规则确定走不走
通过路由规则 还可以可以实现某一类ip或域名的请求 指定出入口 比方说前置代理与中转
hcyme 大佬有话说 : 2020-3-18 08:42:21
学习方法和政策