Improve: UDP relay refactor (#441)
Co-authored-by: Dreamacro <Dreamacro@vip.qq.com>
This commit is contained in:
@ -166,10 +166,19 @@ func (r *Resolver) IsMapping() bool {
|
||||
return r.mapping
|
||||
}
|
||||
|
||||
func (r *Resolver) IsFakeIP() bool {
|
||||
// FakeIPEnabled returns if fake-ip is enabled
|
||||
func (r *Resolver) FakeIPEnabled() bool {
|
||||
return r.fakeip
|
||||
}
|
||||
|
||||
// IsFakeIP determine if given ip is a fake-ip
|
||||
func (r *Resolver) IsFakeIP(ip net.IP) bool {
|
||||
if r.FakeIPEnabled() {
|
||||
return r.pool.Exist(ip)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *Resolver) batchExchange(clients []resolver, m *D.Msg) (msg *D.Msg, err error) {
|
||||
fast, ctx := picker.WithTimeout(context.Background(), time.Second)
|
||||
for _, client := range clients {
|
||||
|
Reference in New Issue
Block a user