Rinka
Rinka
本人学疏才浅,发表一下我的看法。 我认为这不太会是 v2ray 的 bug。大致阅读了关于 dns 查询的代码,并没有发现什么逻辑错误。v2ray 实际进行了无缓存的查询,猜测第一次查询后,操作系统会将查询记录缓存在本机 dns 中,即操作系统的 dns 缓存,即使 v2ray 确实做了 dns 不缓存的操作,再次调用操作系统的 dns 查询接口时,操作系统会直接从其缓存中取出结果并返回,这也许是第二次查询时返回结果很快的原因。要实现真正的无缓存,可能需要在每一次 dns 查询时刷新操作系统 dns 缓存。
您大可这样认为,不过我很清楚自己在做什么。我会继续阅读代码并分析,提出自己的看法和可能的解决方案。如果您有更好的想法和解决方案,或认为鄙人上述所描述的有任何问题,欢迎分享并打脸,我很乐意从他人的经验和批评中学习。
#### 对配置文件的疑惑 对于上述提供的配置文件提出一些看法,配置文件中使用了 `dokodemo-door`,同时在路由中将 `dokodemo-door` 对应的 `inbound` 转发到 `dns-out` 这个 `outbound`,然而这种写法显然与 `dokodemo-door` 和 `protocol: "dns"` 的预期使用方式所违背,直接来说,同时使用者两者本身就是矛盾的,您可以参考 [dokodemo-door](https://www.v2fly.org/config/protocols/dokodemo.html#inboundconfigurationobject) 文档和 [protocol: dns](https://www.v2fly.org/config/protocols/dns.html) 文档,其中 `dokodemo-door` 的 `OutboundConfigurationObject`,即 `settings` 字段表示需要将接收到的流量**转发到哪里**的地址,而 `protocol: dns`,按照您所写的配置,则为原封不动地转发 dns 流量。现在您将两者结合起来,当...
> 打错了不是大括号 我说的就是出站dns. 那个写不写无所谓. 很不幸,这个写不写并**不是**无所谓,如果将其注释掉,`routing.rules` 中关于 `outbound.dns` 的规则会失效,具体到 `inbound.dokodemo`,不匹配任何规则而直接转发到其 `settings` 中的地址,如果 `outbound.dns` 项存在,会转发到 `dns` 中所配置的地址。 > 毫无疑问他流量是直接走任意门设置的 也很不幸,这种情况仅复现于 `outbound.dns` 不存在的情况。 若将 `dns` 中的 dns 配置为可用的,多次查询后也会出现返回 ip 的不同结果。 或许是您与我对所谓无缓存模式的理解偏差有误,v2ray 所期待的行为是: -...
您好,我关于源码中 `translated_refmut` 的实现有些疑惑,具体的代码如下: ``` rust pub fn translated_refmut(token: usize, ptr: *mut T) -> &'static mut T { let page_table = PageTable::from_token(token); let va = ptr as usize; page_table .translate_va(VirtAddr::from(va)) .unwrap()...
Here's what I do: - Remove most of files but keep `v2geo` and `matchers_v2geo.go`; - Rename `matcher.go` to `host_matchers.go` for I think this is helpful; - I only keep `compileHostMatcher`...
To specify local geoip/geosite db files: ```yaml # config.yaml # other field .... geo: geoip: geoip.dat geosite: geosite.dat ```
I didn't find way to lazily build geosite and geoip by only calling `expr.Compile()` so I use `parser.Parse()` and `ast.Walk` to walk on AST before compile. I also move original...
I agree with you, but I have a more question that loading geo files may counter with internet error, while `ast.Visitor` interface doesn't provide us how to return this. I...
I rebase it from [1eb52f7](https://github.com/apernet/OpenGFW/pull/38/commits/1eb52f71af446376a09eab74152b4711341a3810) for making change clear.