|
本帖最后由 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出口。 |
|