v2fly / v2ray-core

A platform for building proxies to bypass network restrictions.
https://v2fly.org
MIT License
29.65k stars 4.67k forks source link

fakedns+others does not work #3140

Open Losalado opened 2 months ago

Losalado commented 2 months ago
          不要使用 `fakedns+others`,因为 `fakedns+others` [从来就没有正常工作过](https://github.com/v2fly/v2ray-core/blob/2a22a8579d485498b2f423af5073fcbcb784c351/app/dispatcher/sniffer.go#L64-L66)。

1b0e046 使得 fakedns+othersfakedns 效果相同(但也不是预期的工作方式),但是 82c42fc 和 3c0aff7 又改坏了。 strings.HasPrefix(protocolString, p) || strings.HasSuffix(protocolString, p)strings.HasPrefix(protocolString, p) || strings.HasPrefix(p, protocolString) 可不是一回事。

Originally posted by @dyhkwong in https://github.com/v2fly/v2ray-core/issues/2973#issuecomment-2080377252

Losalado commented 2 months ago

https://github.com/v2fly/v2ray-core/issues/2973 Could anyone fix fakedns+others issue?

dyhkwong commented 2 months ago

This is because content sniffers skip unsupported network, https://github.com/v2fly/v2ray-core/blob/b7d02ad972c3075ff4dd9c87f6e741876f6747da/app/dispatcher/sniffer.go#L64-L66

but fakedns+others does not specify network, so it will always be skipped.

It is indeed possible to fix this, but fixing this may break current the semantics of other sniffers, especially routing.rules.protocol also uses the protocol value from sniffing. I think new interfaces or methods may be needed.

Losalado commented 2 months ago

This is because content sniffers skip unsupported network, https://github.com/v2fly/v2ray-core/blob/b7d02ad972c3075ff4dd9c87f6e741876f6747da/app/dispatcher/sniffer.go#L64-L66

but fakedns+others does not specify network, so it will always be skipped.

It is indeed possible to fix this, but fixing this may break current the semantics of other sniffers, especially routing.rules.protocol also uses the protocol value from sniffing. I think new interfaces or methods may be needed.

thanks for your info. Actually when I follow document to configure fakedns+others, it does not work. We may need to add note for fakedns+others if it does not work as document now. Of course, it is the best to achieve function we expected.

zeddit commented 1 week ago

想请问 fakedns+others 是否已经正确修复,V2Ray 5.21.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.2 linux/amd64) 好像还是无效的。

Losalado commented 5 days ago

想请问 fakedns+others 是否已经正确修复,V2Ray 5.21.0 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.23.2 linux/amd64) 好像还是无效的。

目前看还没有