Commit Graph

28 Commits

Author SHA1 Message Date
Shelikhoo ba2dd5995d
replace TypedMessage with anypb.Any 2021-09-04 11:13:28 +01:00
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
Loyalsoldier bb44d01096
Format proto files using clang-format according to google style (#264)
* Format proto files using clang-format according to google style
* Regenerate pb.go files
2020-10-05 08:36:40 +08:00
Loyalsoldier ef460f68f8
Adjust Protocol Buffers (#109)
* Update protoc binary executable files to v3.13.0

* Write proto files in more standard way

* Make go generate & vprotogen compatible with protoc-gen-gofast

* Regenerate pb.go files according to new proto files

* Clean go.sum by running go mod tidy

* Implement mustEmbedUnimplementedServiceServer for gPRC services
2020-08-24 12:10:26 +00:00
Darien Raymond 6276bfa508
rename domain override 2018-07-20 13:09:42 +02:00
Darien Raymond c0e37ef34a
prototype for new sniffing mechanism 2018-07-16 13:47:00 +02:00
Darien Raymond a320196b77
refine domain socket transport 2018-04-09 17:09:24 +02:00
Shelikhoo 8b881d7eb6
Rename to prevent confusion 2018-04-05 18:47:36 +08:00
Shelikhoo c51830bd75
Added UnixSenderConfig 2018-04-04 16:45:46 +08:00
Shelikhoo 91f32cc8c4
Auto Gen 2018-02-12 14:47:23 +08:00
Shelikhoo 7b51a56c33
Fix pb err 2018-02-12 14:15:50 +08:00
Shelikhoo 71c3e81a7e
Rebase: Add domainsocket receiver config 2018-02-12 14:07:16 +08:00
Darien Raymond 292d7cc353
massive refactoring for interoperability 2018-01-10 12:22:37 +01:00
Darien Raymond 24395a3e60
comments for protos. 2018-01-04 11:09:23 +01:00
Darien Raymond 77521029b1
support for http and tls header sniffing 2017-04-25 00:19:22 +02:00
Darien Raymond c89cd8ae24
settings for mux concurrency 2017-04-12 10:40:21 +02:00
Darien Raymond 2111c7e9ca
update proto def 2017-04-02 14:24:10 +02:00
Darien Raymond e7a7b38319
Merge branch 'master' of https://github.com/v2ray/v2ray-core 2017-02-07 21:11:50 +01:00
Darien Raymond b652032d9d
update for mux 2017-02-07 21:11:47 +01:00
Darien Raymond d72029211f
completely remove allow passive connection 2017-02-07 17:37:26 +01:00
Darien Raymond b5d14b6823
update java options 2017-02-03 23:15:10 +01:00
Darien Raymond b07d947311
update proto for mux 2017-02-03 23:09:24 +01:00
Darien Raymond ca721230e1
split listening settings from inbound proxies and apply context 2017-01-26 20:46:44 +01:00
Darien Raymond 34a2ae0ab7
implement default outbound handler 2017-01-15 00:48:37 +01:00
Darien Raymond b8f01e0c03
merge sender and receiver to proxyman 2017-01-15 00:17:06 +01:00
Darien Raymond ed3033e785
socks submodule 2017-01-08 10:10:37 +01:00
Darien Raymond 095c29fa8c
decouple outbound handler manager 2016-12-16 23:02:11 +01:00