Comments (11)
试一试 VMess 看看会不会有一样的问题?
from v2ray-core.
试一试 VMess 看看会不会有一样的问题?
忘记补充了,已经试过,一样的
from v2ray-core.
试一试 VMess 看看会不会有一样的问题?
v2ray-core/app/dns/dohdns.go 的 282 行 resp, err := s.httpClient.Do(req.WithContext(ctx))
好像是因为一个DNS请求完成时,Dispatched connection关闭,导致了其他并发请求失败
NewDoHNameServer和NewDoHLNameServer的httpClient不同的http.Transport。
我简单把这行改为了
tr := &http.Transport{
IdleConnTimeout: 90 * time.Second,
ForceAttemptHTTP2: true,
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
dest, err := net.ParseDestination(network + ":" + addr)
if err != nil {
return nil, err
}
conn, err := internet.DialSystem(ctx, dest, nil)
if err != nil {
return nil, err
}
return conn, nil
},
}
hc := &http.Client{
Timeout: time.Second * 180,
Transport: tr,
}
resp, err := hc.Do(req.WithContext(ctx))
这样问题是可以解决的。
但是这样的改法应该是不OK的。
from v2ray-core.
试一试 VMess 看看会不会有一样的问题?
v2ray-core/app/dns/dohdns.go 的 282 行 resp, err := s.httpClient.Do(req.WithContext(ctx))
好像是因为一个DNS请求完成时,Dispatched connection关闭,导致了其他并发请求失败
NewDoHNameServer和NewDoHLNameServer的httpClient不同的http.Transport。我简单把这行改为了
tr := &http.Transport{ IdleConnTimeout: 90 * time.Second, ForceAttemptHTTP2: true, DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { dest, err := net.ParseDestination(network + ":" + addr) if err != nil { return nil, err } conn, err := internet.DialSystem(ctx, dest, nil) if err != nil { return nil, err } return conn, nil }, } hc := &http.Client{ Timeout: time.Second * 180, Transport: tr, } resp, err := hc.Do(req.WithContext(ctx))
这样问题是可以解决的。
但是这样的改法应该是不OK的。
我傻了,这样就是直连没过代理所以没问题了。。。
from v2ray-core.
原因似乎就是因为一个DNS请求完成时,Dispatched connection关闭,导致了其他并发请求失败了?
重新改了一下
给DoHNameServer加了个dispatcher routing.Dispatcher
type DoHNameServer struct {
dispatcher routing.Dispatcher
sync.RWMutex
ips map[string]record
pub *pubsub.Service
cleanup *task.Periodic
reqID uint32
clientIP net.IP
httpClient *http.Client
dohURL string
name string
}
func NewDoHNameServer 中增加了一行
s.dispatcher = dispatcher
282 行 resp, err := s.httpClient.Do(req.WithContext(ctx)) 改成了下方代码
即判断dispatcher是否为空,不为空则是DOH而不是DOHL
DOHL还是原来的处理方式
如果是DOH的话,每个request都是独立的httpClient,就不会因为一个请求完成而中断了connection导致其他的请求失败了。
hc := s.httpClient
if s.dispatcher != nil {
tr := &http.Transport{
MaxIdleConns: 30,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 30 * time.Second,
ForceAttemptHTTP2: true,
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
dest, err := net.ParseDestination(network + ":" + addr)
if err != nil {
return nil, err
}
link, err := s.dispatcher.Dispatch(ctx, dest)
if err != nil {
return nil, err
}
return net.NewConnection(
net.ConnectionInputMulti(link.Writer),
net.ConnectionOutputMulti(link.Reader),
), nil
},
}
hc = &http.Client{
Timeout: time.Second * 180,
Transport: tr,
}
}
resp, err := hc.Do(req.WithContext(ctx))
这样能解决问题。
但是这样处理看起来似乎有点笨拙。。。
from v2ray-core.
ping @vcptr
from v2ray-core.
dnsCtx = session.ContextWithMuxPrefered(dnsCtx, true)
你把这行删掉试试还有没有问题?如果没有的话我就提交补丁
from v2ray-core.
dnsCtx = session.ContextWithMuxPrefered(dnsCtx, true)
你把这行删掉试试还有没有问题?如果没有的话我就提交补丁
不行,依然是一堆io: read/write on closed pipe
from v2ray-core.
有客户端1使用远程doh,客户端2不使用远程dns
在客户端1dns解析失败的时候服务端可以看到日志127.0.0.1:60352 accepted tcp:dns.google:443
此时用客户端2下的浏览器访问https://dns.google/dns-query 也是无法打开的,但是访问其他网站没有毛病,服务端日志正常
再同时vps上运行curl https://dns.google/dns-query 也没有问题
感觉问题可能出在服务端而未必是客户端
from v2ray-core.
测试了段时间,可能跟Freedom的"domainStrategy": "UseIP"参数有关,vps上ipv6只是局域网没有公网出口,现在改成UseIPv4,有问题再说
from v2ray-core.
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days
from v2ray-core.
Related Issues (20)
- V2ray 如何将vmess url翻译成json? HOT 1
- 节点连接成功了为什么还登不上Tik Tok HOT 2
- Leaking Public IP address
- ws transport writes/reads invalid data HOT 2
- V5 格式配置 ws.header 报错 HOT 2
- Can't access via Linux, but works on windows and ios
- 日志输出大量 rejected common/drain: common/drain: unable to drain connection > EOF > proxy/shadowsocks: failed to read IV > EOF
- 服务端开启Shadowsocks的UDP设置之后必须在防火墙添加与Shadowsocks入站TCP端口一致的UDP端口才能使UDP流入
- V5 格式无法配置 dns expectIPs HOT 1
- 订阅服务器解析 vless 链接不成功
- 建议为sniffing增加route_only选项或判断destOverride的域名是否有效以增强对Tor的兼容性 HOT 1
- kali linux 上使用V2RAY, 必须要在浏览器里指定代理,才能用,但是系统其他应用还是不能被代理,请问怎么样设置才能实现系统级代理
- A bug encountered when loading configuration text via STDIN HOT 1
- failed to read response from cachefly.cachefly.net > io: read/write on closed pipe and no access via v2rayn HOT 1
- Flutter iOS v2ray-core plugin
- v2ray.exe闪退
- Decrease FakeDNS TTL HOT 1
- Mismatch between digset in the "Release" file and independent/actual for zip file releases
- v5.16.1 版本跟nginx不能共存 v5.16.0可以
- 手动构建的二进制有有效期限制?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v2ray-core.