1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-14 00:07:09 -05:00
Commit Graph

1167 Commits

Author SHA1 Message Date
Loyalsoldier
f94dd11a8c
Chore: change module name (#677) 2021-02-17 04:31:50 +08:00
Loyalsoldier
f98944c9e0
Chore: update protobuf (#670) 2021-02-11 14:57:20 +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
database64128
484d740800
🔙 Revert "Add traffic stat of every request in access log (#642)" (#644)
This reverts commit af0120e771.
2021-01-30 20:32:34 +08:00
刘志龙
af0120e771
Add traffic stat of every request in access log (#642)
* Add traffic stat of every request in access log

* Fix: record pointer may be null

* Clarify the data unit in access log
2021-01-30 01:47:13 +08:00
DarthVader
de618121ad
Refactor: A faster DomainMatcher implementation (#587)
* a faster DomainMatcher implementation

* rename benchmark name

* fix linting errors
2021-01-20 15:53:07 +08:00
Kslr
795a3f632d
Test: fix race issue (#598)
other "race" problems are only in the test, and so I deleted the detection
2021-01-11 20:50:58 +08:00
V2Fly Team
66e203f156
DNS: refine skipRoutePick (#558) 2020-12-30 18:35:19 +08:00
database64128
3c988693b5
🕳 Prevent trailing whitespaces in logs (#526) 2020-12-17 05:03:26 +08:00
Loyalsoldier
8cb2db5321
Fix: security issues & overflow potentiality (#465) 2020-11-28 21:56:20 +08:00
Loyalsoldier
b68f943c78
Fix lint according to golangci-lint (#439) 2020-11-22 05:05:01 +08:00
Chinsyo
32e0e6e484
Some minor fix (#430)
* fix typo pading to padding

* reorder common/buf/buffer.go code layout

* delete unused common/stack

Co-authored-by: Chinsyo <chinsyo@sina.cn>
2020-11-18 04:23:30 +08:00
Chinsyo
dc78733196
Refactor common/antireplay, unexport unnecessary public fields. (#422)
* rename AuthIDDecoderHolder private fields

* ignore unused return value more clear

* change PoolSwap to private fields

* refactor Unlock to defer

* use const capacity, reorder code layout

* replace mismatch field name poolX with type Filter

* change AntiReplayTime to private fileds, protect to modify

* rename lastSwapTime to lastSwap

* merge duplicate time.Now.
Since the current unit is in seconds, there is no need to repeat the call

* refine negate expression

* rename antiReplayTime to interval

* add docs

* fix lint stutter issue, rename antireplay.AntiReplayWindow to antireplay.ReplayFilter

* rename fileds m,n to poolA,poolB

* rename antireplay.go to replayfilter.go

* fix build issue

Co-authored-by: Chinsyo <chinsyo@sina.cn>
2020-11-17 21:05:26 +08:00
RPRX
7cc8b75006
Reorder dice_test.go 2020-11-14 05:06:07 +00:00
Chinsyo
bdf715afa9
rand.Intn(65536) -> rand.Int63() >> 47 (#417)
* Optimize rand.Intn(65536) to rand.Int31() >> 15, with ~20% performance improvement.

* Optimize rand.Intn(65536) to rand.rand.Int63() >> 47

* Remove rand.Seed call duplicate with original source code

Co-authored-by: Chinsyo <chinsyo@sina.cn>
2020-11-14 05:00:25 +00:00
lucifer
770b994337
Refine unix domain socket (#367) 2020-10-29 07:30:38 +00:00
loyalsoldier
784775f689
Refine code according to golangci-lint results 2020-10-11 19:22:46 +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
b181045b0c
Errorgen: support to run outside of GOPATH 2020-10-04 13:06:12 +08:00
loyalsoldier
0650af46f4
Refine errorgen 2020-10-04 13:06:11 +08:00
loyalsoldier
4130b54579
Support to read go.mod recursively to get module path 2020-10-04 12:47:22 +08:00
loyalsoldier
4ba4cad7ae
Refine func GetModuleName 2020-10-04 09:55:21 +08:00
Vigilans
5a497890e6 Routing Context: Fix GetUser() & Use string for Attributes Value 2020-09-13 00:34:35 +08:00
Vigilans
f9d37b724c Extract session information during routing as routing context 2020-09-04 11:32:19 +08:00
loyalsoldier
323ef03f02
Minor fixes 2020-09-01 08:46:55 +08:00
Vigilans
47c997d75e Fix github.com/v2fly/v2ray-core/issues/146 2020-08-31 12:21:56 +08:00
loyalsoldier
f12f76582f
Fix according to staticcheck result
staticcheck repo: https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck
2020-08-30 23:41:15 +08:00
loyalsoldier
a2a064a54d
protoc: do NOT rely on GOBIN & GOPATH
Add public functions
2020-08-27 23:18:05 +08:00
loyalsoldier
f9175e3bc8
Fix according to go vet results 2020-08-26 19:35:33 +08:00
Isaac
588b40ffad
Fix a typo
Fix a typo in bytes.go
2020-08-25 17:55:53 +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
Kslr
dabefc6338
Merge pull request #98 from Vigilans/vigilans/dns-server-matcher-info
Refactor & Log rules matching of built-in DNS's domain matcher
2020-08-18 01:01:06 +08:00
vcptr
bc008113b6 add asset location search 2020-08-17 18:56:01 +08:00
Vigilans
dfeaef75e7 Refactor DNS Server to record original rule of domain matchers 2020-08-16 22:18:12 +08:00
Vigilans
1ab9e58dce Supply test for domain matcher group 2020-08-15 21:28:34 +08:00
Vigilans
1e222425b6 Amend domain matcher with returning values of all matched subdomains 2020-08-13 15:26:30 +08:00
Vigilans
c74a33f827 Amending domain matcher with returning array of all matches 2020-08-11 13:31:04 +08:00
RPRX
e425876afe
Fix totalSize 2020-08-04 03:50:22 +00:00
Vigilans
30e312f72b Apply sockopt from inbound config to dokodemo tproxy's response connection 2020-08-01 02:04:06 +08:00
DuckSoft
1525712214
some typo fixes
note: there are other typos in external/ folder.
considering the fact that the folder "will be removed in future", I skipped those typos.
2020-07-17 18:09:24 +08:00
Roger Shimizu
90af5f19ba
Apply Debian's patch to upstream 2020-06-24 12:57:03 +08:00
Shelikhoo
09b81b78c3
regenerate pb data 2020-06-08 16:16:32 +08:00
Shelikhoo
9bf07b1f26
VMess AEAD Experiment 2020-06-06 17:11:30 +08:00
Shelikhoo
5e59534333
Fix when rolled number is zero 2020-06-02 17:30:48 +08:00
Shelikhoo
d671780804
Drain Connection Based on Uuid based Behavior seed 2020-06-02 14:47:54 +08:00
Shelikhoo
e0aa18b6f3
Drain Connection with invalid checksum before closing. Emergency fix for weakness described in https://github.com/v2ray/v2ray-core/issues/2523 2020-06-01 16:40:54 +08:00
Araragi Hokuto
2a96605138
Fix build failure on illumos
Previously v2ray can not be built on illumos due to following reasons:
1. missing build tags in transport/internet/sockopt_other.go
2. many definitions in syscall does not exist on illumos
This commit addresses these problems by adding missing build tags, and
updates those missing syscall deps on illumos to use x/sys/unix.
2020-05-31 12:37:24 +08:00
mzz
49b63cbd79 code quality review 2020-03-24 22:26:03 +08:00
mzz2017
9e84ce38dd feat: support more types of certificates 2020-03-24 22:26:03 +08:00
vcptr
0d71d3dcf8 revert back to multiconfig 2020-03-19 19:11:16 +08:00