1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-01 03:25:23 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
Loyalsoldier
f94dd11a8c
Chore: change module name (#677) 2021-02-17 04:31:50 +08:00
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
Shelikhoo
85bd352bc1
propagate context 2020-06-18 12:37:10 +08:00
Darien Raymond
769f770cf7
migrate NetworkList to []Network 2018-11-20 16:58:26 +01:00
Darien Raymond
838f2919ab
move mux to common 2018-10-23 12:21:12 +02:00
Darien Raymond
383b84e7dd
unified tproxy option 2018-09-17 15:12:58 +02:00
Darien Raymond
b3847fb7c0
MemoryStreamSettings 2018-09-07 14:50:25 +02:00
Darien Raymond
c0e37ef34a
prototype for new sniffing mechanism 2018-07-16 13:47:00 +02:00
Darien Raymond
adade2bffd
fix lint warnings 2018-05-31 11:55:11 +02:00
Darien Raymond
13f3c356ca
unified task package 2018-05-27 13:02:29 +02:00
Darien Raymond
c76d492c0f
stats counter for inbound traffic 2018-04-12 00:10:14 +02:00
Darien Raymond
88b25d38cb
simplify context retrieval 2018-02-21 17:05:29 +01:00
Darien Raymond
efcb567273
remove context in struct 2018-02-08 15:39:46 +01:00
Darien Raymond
292d7cc353
massive refactoring for interoperability 2018-01-10 12:22:37 +01:00
Darien Raymond
f4c35db968
merge log into common log 2017-12-19 21:28:12 +01:00
Darien Raymond
1c856a46ab step 1 to remove reference to net package 2017-08-29 12:56:57 +02:00
Darien Raymond
5829b45bbe
close timer faster 2017-05-09 00:01:15 +02:00
Darien Raymond
77521029b1
support for http and tls header sniffing 2017-04-25 00:19:22 +02:00
Darien Raymond
35248497d2
refactor error messages 2017-04-09 01:43:25 +02:00
Darien Raymond
67956b9120
update error message 2017-04-06 21:44:20 +02:00
Darien Raymond
75f5cb9afb
refactor log and error 2017-04-06 21:13:17 +02:00
Darien Raymond
1e06cf34d9
apply mux in inbound handler 2017-04-02 14:06:20 +02:00
Darien Raymond
02028bf8be
fix panic when there is no available handler 2017-02-13 13:08:28 +01:00
Darien Raymond
d72029211f
completely remove allow passive connection 2017-02-07 17:37:26 +01:00
Darien Raymond
43fb425fd7
unified dispatcher interface 2017-02-03 22:50:01 +01:00
Darien Raymond
c4d0227977
simplify dialer and dispatcher parameters 2017-02-03 22:35:09 +01:00
Darien Raymond
f046f334cd
move common/log to app/log 2017-02-01 21:35:40 +01:00
Darien Raymond
509700eddb
typo 2017-01-30 21:37:50 +01:00
Darien Raymond
e7aa920c27
refine dyn port 2017-01-30 21:35:34 +01:00
Darien Raymond
bfcc75f5d1
fix goroutine leak in dynamic port 2017-01-29 12:58:52 +01:00
Darien Raymond
c5ecdc8078
fix nil address in inbound proxyman 2017-01-27 23:52:29 +01:00
Darien Raymond
7f36a5d1d3
rename proxy interfaces 2017-01-26 20:57:18 +01:00
Darien Raymond
ca721230e1
split listening settings from inbound proxies and apply context 2017-01-26 20:46:44 +01:00