1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00
Go to file
Xiaokang Wang 38da831b75
Feature: Fake DNS support (#406)
* Add fake dns

A new config object "fake" in DnsObject for toggling fake dns function

Compare with sniffing, fake dns is not limited to http and tls traffic.
It works across all inbounds. For example, when dns request come
from one inbound, the local DNS server of v2ray will response with a
unique fake IP for every unique domain name. Then later on v2ray
received a request to one of the fake IP from any inbounds, it will
override the request destination with the previously saved domain.

By default, v2ray cache up to 65535 addresses. The old records will
be discarded bases on LRU. The fake IP will be 240.x.x.x

* fix an edge case when encounter a fake IP in use

* Move lru to common.cache package

* Added the necessary change to obtain request IP from sniffer

* Refactor the code so that it may stop depending on global variables in the future.

* Replace string manipulation code with more generic codes, hopefully this will work for both IPv4 and IPv6 networks.

* Try to use IPv4 version of address if possible

* Added Test Case for Fake Dns

* Added More Test Case for Fake Dns

* Stop user from creating a instance with LRU size more than subnet size, it will create a infinite loop

* Move Fake DNS to a separate package

* Generated Code for fakedns

* Encapsulate Fake DNS as a Instance wide service

* Added Support for metadata sniffer, which will be used for Fake DNS

* Dependency injection for fake dns

* Fake DNS As a Sniffer

* Remove stub object

* Remove global variable

* Update generated protobuf file for metadata only sniffing

* Apply Fake DNS config to session

* Loading for fake dns settings

* Bug fix

* Include fake dns in all

* Fix FakeDns Lint Condition

* Fix sniffer config

* Fix lint message

* Fix dependency resolution

* Fix fake dns not loaded as sniffer

* reduce ttl for fake dns

* Apply Coding Style

* Apply Coding Style

* Apply Coding Style

* Apply Coding Style

* Apply Coding Style

* Fix crashed when no fake dns

* Apply Coding Style

* Fix Fake DNS do not apply to UDP socket

* Fixed a bug prevent FakeDNS App Setting from become effective

* Fixed a caveat prevent FakeDNS App Setting from become effective

* Use log comparison to reduce in issue when it comes to really high value typical for ipv6 subnet

* Add build tag for fakedns

* Removal of FakeDNS specific logic at DNS client: making it a standard dns client

* Regenerate auto generated file

* Amended version of configure file

* Bug fixes for fakeDNS

* Bug fixes for fakeDNS

* Fix test: remove reference to removed attribute

* Test: fix codacy issue

* Conf: Remove old field support

* Test: fix codacy issue

* Change test scale for TestFakeDnsHolderCreateMappingAndRollOver

* Test: fix codacy issue

Co-authored-by: yuhan6665 <1588741+yuhan6665@users.noreply.github.com>
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: kslr <kslrwang@gmail.com>
2021-02-08 18:18:52 +08:00
.github Chore: bump actions/cache from v2 to v2.1.4 (#659) 2021-02-08 14:56:22 +08:00
app Feature: Fake DNS support (#406) 2021-02-08 18:18:52 +08:00
common Feature: Fake DNS support (#406) 2021-02-08 18:18:52 +08:00
features Feature: Fake DNS support (#406) 2021-02-08 18:18:52 +08:00
infra Feature: Fake DNS support (#406) 2021-02-08 18:18:52 +08:00
main Feature: Fake DNS support (#406) 2021-02-08 18:18:52 +08:00
proxy Feature: Fake DNS support (#406) 2021-02-08 18:18:52 +08:00
release update geoip, geosite 2021-02-05 00:10:02 +00:00
testing Chore: format code (#600) 2021-01-12 10:44:12 +08:00
transport Test: fix http2 dial timeout (#570) 2021-01-11 17:03:03 +08:00
.gitignore fix(#2211): problem that AAAA query returns A result 2020-03-12 00:42:29 +08:00
annotations.go API doc 2018-12-03 22:44:42 +01:00
config.go Apply Debian's patch to upstream 2020-06-24 12:57:03 +08:00
config.pb.go Format proto files using clang-format according to google style (#264) 2020-10-05 08:36:40 +08:00
config.proto Format proto files using clang-format according to google style (#264) 2020-10-05 08:36:40 +08:00
context_test.go test case for context 2018-10-21 20:33:08 +02:00
context.go Add unit test for outbound handler 2020-06-27 20:50:39 -04:00
core.go 🆙 Bump version to v4.34.0 2021-01-04 19:19:44 +08:00
errors.generated.go simplify error creation 2018-09-30 18:39:53 +02:00
functions_test.go fix connection reading in UDP 2019-01-06 00:34:38 +01:00
functions.go Fix lint according to golangci-lint (#439) 2020-11-22 05:05:01 +08:00
go.mod Chore: bump github.com/miekg/dns from 1.1.37 to 1.1.38 (#652) 2021-02-02 14:29:17 +08:00
go.sum Chore: bump github.com/miekg/dns from 1.1.37 to 1.1.38 (#652) 2021-02-02 14:29:17 +08:00
LICENSE Update rights owner 2020-10-07 14:34:00 +08:00
mocks.go Mockgen: do NOT rely on GOBIN & GOPATH 2020-08-26 18:54:58 +08:00
proto.go fix: vprotogen in windows (#365) 2020-10-29 09:04:12 +08:00
README.md Refine: readme packaging badge 2020-12-24 03:50:13 +08:00
SECURITY.md update security policy with renewed GPG pubkey 2020-11-08 03:54:22 -06:00
v2ray_test.go Some minor fixes (#433) 2020-11-20 01:02:52 +08:00
v2ray.go Refine code according to golangci-lint results 2020-10-11 19:22:46 +08:00

V2Ray

Project V

Project V is a set of network tools that helps you to build your own computer network. It secures your network connections and thus protects your privacy.

GitHub Test Badge codecov.io codebeat Codacy Badge Downloads

Packaging Status

If you are willing to package V2Ray for other distros/platforms, please let us know or seek for help via GitHub issues.

Packaging status

License

The MIT License (MIT)

Credits

This repo relies on the following third-party projects: