Magisk-Modules-Repo / v2ray

v2ray core
336 stars 86 forks source link

无法访问raw.githubusercontent.com #60

Open marillindie opened 4 years ago

marillindie commented 4 years ago

配置文件我觉得已经足够全局了,是不是在v2ray本体上层存在对 raw.githubusercontent.com 的强制豁免?如有,希望去除,因为该网站无法直连但是可以用其他代理软件连接。

以下是配置文件:

// Uncomment entries below to satisfy your needs. Also read our manual for more detail at
// https://www.v2ray.com/
{
  "log": {
    // By default, V2Ray writes access log to stdout.
    // "access": "/path/to/access/log/file",

    // By default, V2Ray write error log to stdout.
    // "error": "/path/to/error/log/file",
    "error": "/data/v2ray/run/error.log",

    // Log level, one of "debug", "info", "warning", "error", "none"
    "loglevel": "info"
  },
  // List of inbound proxy configurations.
  "inbounds": [{
    // Just listen for DNS proxy.
    "port": 65534,

    // Tag of the inbound for DNS proxy routing.
    "tag": "dns-in",

    // DNS proxy protocol must be dokodemo-door.
    "protocol": "dokodemo-door",

    // Setting of DNS proxy.
    "settings": {
      "port": 53,
      "address": "1.1.1.1",
      "network": "tcp,udp"
    }
  },{
    // Port to listen on. You may need root access if the value is less than 1024.
    "port": 65535,

    // IP address to listen on. Change to "0.0.0.0" to listen on all network interfaces.
    "listen": "0.0.0.0",

    // Tag of the inbound proxy. May be used for routing.
    "tag": "proxy-inbound",

    // Protocol name of inbound proxy.
    "protocol": "dokodemo-door",

    // Settings of the protocol. Varies based on protocol.
    "settings": {
      // Disable timeout setting for keeping persistent connection. Such as FCM.   
      //  "timeout": 10,
      "network": "tcp,udp",
      "followRedirect": true
    },

    // Enable sniffing on TCP connection.
    "sniffing": {
      "enabled": true,
      // Target domain will be overriden to the one carried by the connection, if the connection is HTTP or HTTPS.
      "destOverride": ["http", "tls"]
    }
  }],
  // List of outbound proxy configurations.
  "outbounds": [{
    "protocol": "vmess",
    "settings": {...},
    "streamSettings":{
      "network": "http",
      "security": "tls",
      "tlsSettings": {...},
      "httpSettings": {...}
    },
    "tag": "http/2"
  },{
    // Protocol name of the outbound proxy.
    "protocol": "freedom",

    // Settings of the protocol. Varies based on protocol.
    "settings": {
      "domainStrategy": "UseIP"
    },

    // Tag of the outbound. May be used for routing.
    "tag": "direct"
  },{
    // DNS Proxy Outbond
    "protocol": "dns",

    // Tag of the outbound for DNS proxy routing.
    "tag": "dns-out"
  },{
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  },{
    "protocol": "freedom",
    "tag": "unchanged"
  }],

  // Transport is for global transport settings. If you have multiple transports with same settings
  // (say mKCP), you may put it here, instead of in each individual inbound/outbounds.
  //"transport": {},

  // Routing controls how traffic from inbounds are sent to outbounds.
  "routing": {
    "domainStrategy": "IPOnDemand",
    "balancers": [
      {
        "tag": "proxy",
        "selector": ["http/2"]
      }
    ],
    "rules": [
      // DNS
      {
        // Proxy DNS request
        "type": "field",
        "inboundTag": ["dns-in"],
        "outboundTag": "dns-out"
      },
      {
        "type": "field",
        "domain": ["domain:...(服务器域名)"],
        "outboundTag": "unchanged"
      },
      // Fallback: Proxy
      {
        "type": "field",
        "network": "tcp,udp",
        "balancerTag": "proxy"
      }
    ]
  },

  // Dns settings for domain resolution.
  "dns": {
    // Static hosts, similar to hosts file.
    "hosts": {
      // Match v2ray.com to another domain on CloudFlare. This domain will be used when querying IPs for v2ray.com.
      "domain:v2ray.com": "www.vicemc.net",

      // The following settings help to eliminate DNS poisoning in mainland China.
      // It is safe to comment these out if this is not the case for you.
      "domain:github.io": "pages.github.com",
      "domain:wikipedia.org": "www.wikimedia.org",
      "domain:shadowsocks.org": "electronicsrealm.com"
    },
    "servers": [
      "1.1.1.1",
      "localhost"
    ]
  },

  // Policy controls some internal behavior of how V2Ray handles connections.
  // It may be on connection level by user levels in 'levels', or global settings in 'system.'
  "policy": {
    // Connection policys by user levels
    "levels": {
      "0": {
        "uplinkOnly": 0,
        "downlinkOnly": 0
      }
    },
    "system": {
      "statsInboundUplink": false,
      "statsInboundDownlink": false
    }
  }
}
marillindie commented 4 years ago

当然,可以用systemless-hosts添加hosts记录解决

marillindie commented 4 years ago

又获得了新方案:用hosts将网站重定向回127.0.0.1,再用iptables将443端口转发至其他端口(>1000),然后用V2Ray代理

lyq1996 commented 4 years ago

你解决了吗?看起来根本就没走v2ray的DNS proxy

whalechoi commented 4 years ago

使用dnscrypt-proxy接管系统dns,彻底解决内网污染。 #71

gouwenyong0000 commented 2 years ago

在host文件下添加 185.199.108.133 raw.githubusercontent.com 参考https://www.ioiox.com/archives/62.html