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

1348 Commits

Author SHA1 Message Date
Shelikhoo
6472e8ecd3
added V2 protobuf extensions 2021-09-04 11:13:31 +01:00
Shelikhoo
d0521c3861
added protobuf descriptor into repo 2021-09-04 11:13:31 +01:00
Shelikhoo
b36b434689
jsonpb format 2021-09-04 11:13:30 +01:00
Shelikhoo
32374eb545
added jsonpb format support 2021-09-04 11:13:29 +01:00
Shelikhoo
ba2dd5995d
replace TypedMessage with anypb.Any 2021-09-04 11:13:28 +01:00
Shelikhoo
ba0d5a3275
tagged features creator & config 2021-09-04 11:12:33 +01:00
Shelikhoo
32fcdeb15a
tagged features: auto generated file 2021-09-04 11:12:33 +01:00
Shelikhoo
72964b5325
tagged features 2021-09-04 11:12:33 +01:00
Shelikhoo
9cb1566a78
moving health ping to observatory as a standalone component 2021-09-04 11:12:30 +01:00
Shelikhoo
718d6f32bf
update coding style 2021-09-04 11:12:04 +01:00
Jebbs
2523d77919
improve commands
(rebased from ebbf31f07e)
2021-09-04 11:11:45 +01:00
Jebbs
fa0cf6db26
v5: Health Check & LeastLoad Strategy (rebased from 2c5a714903)
Some changes will be necessary to integrate it into V2Ray
2021-09-04 11:11:45 +01:00
young-zy
12dfbc78a3
Update protobuf version (rebased from 6d25d51519)
Some change is not adopted since it would break the code base. These changes will be reintroduced at a later date.
2021-09-04 11:09:58 +01:00
Jebbs
b05a469488
v5: Remove v2ctl & wv2ray (rebased from 7c1ab06206) 2021-09-04 11:09:55 +01:00
Jebbs
557b0c3353
V5: YAML support (rebased from 9367e9b1f2) 2021-09-04 11:05:52 +01:00
CalmLong
96a4ab8a77
remove "v2ray.com/core" in log (rebased from 9c1ad3ab93) 2021-09-04 11:05:38 +01:00
database64128
c78ee5aac7
🏡 Housekeeping: Update to Go 1.17 (#1215)
* ⬆ Update to Go 1.17

* 🏗 Update workflows and add windows-arm64

* 💾 Update generated files

* 📛 Update not-so-friendly filenames
2021-08-21 13:20:40 +08:00
Loyalsoldier
639148dda4
Refinement: LRU (#1142) 2021-08-10 11:08:45 +08:00
Shelikhoo
1409be04c2
regenerate protobuf files 2021-07-01 18:58:48 +01:00
Shelikhoo
3c17276462
drain: add generated file 2021-06-22 12:26:21 +01:00
Shelikhoo
79174ab2a0
unified drain support for vmess and shadowsockets 2021-06-22 12:26:17 +01:00
Shelikhoo
0822160008
VMess AEAD based packet length 2021-06-22 12:26:01 +01:00
Loyalsoldier
6f8979d017
Style: format code by gofumpt (#1022) 2021-05-20 05:28:52 +08:00
Loyalsoldier
a771e3401a
Fix: lint error (#995) 2021-05-11 08:36:06 +08:00
Shelikhoo
916d3857a0
Revert "show warning for asset directory transversal to prepare for network api based reload in v5"
This reverts commit a720d1e2
2021-05-05 13:29:36 +01:00
Shelikhoo
a720d1e2d6
show warning for asset directory transversal to prepare for network api based reload in v5 2021-05-05 13:17:54 +01:00
Loyalsoldier
8ce32e0d4c
Fix: GetAssetLocation (#974) 2021-05-05 00:51:58 +01:00
Loyalsoldier
1cb9fd2999
Chore: little refinements (#973) 2021-05-05 07:28:09 +08:00
loyalsoldier
bf9a27a6db
Revert "Revert "Fix: GetAssetLocation for external geo files (#968)""
This reverts commit 70245fd30e.
2021-05-05 06:39:00 +08:00
Shelikhoo
44514ebc1a
Merge branch 'dev-wsearlydatadiverse' 2021-05-04 22:50:06 +01:00
Shelikhoo
9458963b5a
Revert "Refactor: memory-efficient geo file decoder (#934)"
This reverts commit 7e876709
2021-05-04 19:07:54 +01:00
Shelikhoo
355a9c853b
Revert "Refinement: geodata decoder removes unnecessary GC & exports methods for 3rd party (#965)"
This reverts commit de71e638
2021-05-04 19:07:49 +01:00
Shelikhoo
ace2c44c2b
Revert "Refine geodata related tests (#967)"
This reverts commit 7805ca2a
2021-05-04 19:07:35 +01:00
Shelikhoo
70245fd30e
Revert "Fix: GetAssetLocation for external geo files (#968)"
This reverts commit 51c8ab83
2021-05-04 19:07:31 +01:00
Loyalsoldier
51c8ab8338
Fix: GetAssetLocation for external geo files (#968) 2021-05-04 19:05:50 +08:00
Loyalsoldier
7805ca2ac1
Refine geodata related tests (#967) 2021-05-04 16:30:23 +08:00
Loyalsoldier
de71e63893
Refinement: geodata decoder removes unnecessary GC & exports methods for 3rd party (#965) 2021-05-04 01:39:47 +08:00
rurirei
238b87d26a
Fix: geodata reader for multi-platform compatibility (#964) 2021-05-04 00:12:47 +08:00
Shelikhoo
b3957e029c
update browser forwarder script 2021-05-01 15:59:10 +01:00
Loyalsoldier
a585ca28a8
Fix: code not found in geo files (#953) 2021-05-01 17:54:47 +08:00
Loyalsoldier
7e876709fe
Refactor: memory-efficient geo file decoder (#934) 2021-05-01 07:59:29 +08:00
Shelikhoo
6dcdd2afad
Merge branch 'dev-advloadblancer-2' 2021-04-13 15:09:32 +01:00
Loyalsoldier
4bbe672ffd
Test: add test to avoid the error of missing geoip & geosite (#895) 2021-04-13 10:52:01 +08:00
Loyalsoldier
7790d33185
Fix: v2ray.location.asset env not working (#889) 2021-04-12 10:01:30 +08:00
Loyalsoldier
f71b45f3e7
Chore: fix typos (#878) 2021-04-09 09:47:36 +08:00
Shelikhoo
a553ccc4c4
report transportation error to observer 2021-04-08 23:17:00 +01:00
Loyalsoldier
10ca68f277
Feat: remove geo files from repo & refine tests (#869) 2021-04-07 03:08:03 +08:00
Kslr
b8af713998
Fix: secured loading path under windows (#851)
* Fix: secured loading path under windows

* fix sign file foramts
2021-04-04 16:32:42 +08:00
Shelikhoo
93e44b72d9
rework the file name checking logic 2021-04-03 10:14:23 +01:00
kslr
78c1993431 fix logs prefix matching order 2021-04-02 22:24:14 +08:00
kslr
01380177b8 refine package prefix cleanup 2021-04-02 22:04:53 +08:00
Shelikhoo
0b39c3beb0
Update bundled browserforwarder firmware 2021-04-02 14:07:21 +01:00
Loyalsoldier
c80a6df749
Chore: format code (#842) 2021-04-02 20:49:45 +08:00
Kslr
1b665d1d36
remove package path from logs (#840) 2021-04-02 20:44:33 +08:00
Shelikhoo
3476a0e1d1
Update bundled browserforwarder firmware 2021-04-02 12:24:39 +01:00
Shelikhoo
d55d5423fb
use shadowsocket's bloomring for shadowsocket's replay protection 2021-04-01 21:01:39 +01:00
Shelikhoo
e4681e8cd3
added shadowsockets iv check for tcp socket 2021-04-01 20:59:35 +01:00
loyalsoldier
090a659cab
Chore: fix lint 2021-03-28 09:33:00 +08:00
loyalsoldier
a0c817888b
Chore: format code 2021-03-28 08:44:04 +08:00
loyalsoldier
24948c6520
Merge branch 'master' into dev-wsimprovement 2021-03-28 08:40:05 +08:00
Loyalsoldier
ad09269791
Chore: refine errorgen (#821) 2021-03-24 15:18:07 +08:00
Shelikhoo
aac35a833d
added hash of browser forwarding asset to embedded hash 2021-03-20 22:05:04 +00:00
Shelikhoo
f63ee69fcf
added forwarder service 2021-03-20 21:59:30 +00:00
Shelikhoo
2d778239a3
added necessary infrastructure 2021-03-20 21:58:07 +00:00
Loyalsoldier
9e9173acb4
Chore: update protobuf & dependencies (#793)
* Chore: update protobuf
* Chore: regenerate mock files
* Chore: update dependencies
* Chore: use Go v1.16.2 and later
2021-03-18 12:17:26 +08:00
DarthVader
c71ae9b310
Fix: core panics when zero domain/full type of rule (#786) 2021-03-16 19:07:32 +08:00
DarthVader
ac1e5cd925
Add minimal perfect hash domain matcher (#743)
* rename to HybridDomainMatcher & convert domain to lowercase

* refactor code & add open hashing for rolling hash map

* fix lint errors

* update app/dns/dns.go

* convert domain to lowercase in `strmatcher.go`

* keep the original matcher behavior

* add mph domain matcher & conver domain names to loweercase when matching

* fix lint errors

* fix lint errors
2021-03-15 15:21:38 +08:00
Loyalsoldier
e46204f828
Chore: fix lint according to golangci-lint errors (#781)
* Chore: fix lint according to golangci-lint errors
* Chore: regenerate pb.go files
2021-03-14 07:44:47 +08:00
Loyalsoldier
88e1e25aa9
Chore: format import using goimports (#780) 2021-03-14 07:09:51 +08:00
Loyalsoldier
e03947e6b0
Chore: update protobuf & dependencies (#748) 2021-03-08 05:12:27 +08:00
Shelikhoo
867bbb429e
create session content in the context if do not exist yet 2021-03-06 14:33:20 +00:00
Shelikhoo
b585f2283a
fixing misbehaving code in mux that do not propagate context 2021-03-06 14:31:46 +00:00
Shelikhoo
7dabfb755e
merge vmess zero encryption support 2021-03-04 00:12:37 +00:00
Shelikhoo
0010783191
Merge chained proxy with transport support 2021-03-03 23:27:26 +00:00
DarthVader
a31a8e6f89
A memory-efficient and fast hybrid matcher (#639)
* a faster DomainMatcher implementation

* rename benchmark name

* fix linting errors

* add hybrid matcher

* add rabin-karp algorithm

* rename test & fix linting errors

* add more comment

* format code

* revert `MatcherGroup` match func

* fix linting errors
2021-03-04 05:39:51 +08:00
Loyalsoldier
49cf614346
Chore: update dependencies & protobuf (#728) 2021-03-03 17:31:53 +08:00
Shelikhoo
770a2bc1a3
Regenerate protobuf for Zero Security imaginary security level 2021-03-01 15:32:19 +00:00
Shelikhoo
833997df5a
Zero Security imaginary security level 2021-03-01 15:30:36 +00:00
Shelikhoo
616b0d122e
Fix for context with empty content 2021-02-28 20:42:32 +00:00
Shelikhoo
dd51d32250
Added Transport Layer Chained Proxy Support 2021-02-28 18:47:31 +00:00
Kid
d2a4e6bc47
Add /opt to assets location (#715) 2021-02-27 17:09:48 +08:00
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
vcptr
04a0c04934 doh route strategy optimized 2020-03-12 00:42:29 +08:00
Kslr
fdbec9a141
Revert "multiple config" 2020-01-02 01:23:56 +08:00
Kslr
e6f226c64d
Revert "add arg -confdir" 2020-01-02 01:14:36 +08:00
vcptr
8ccc142e7e add comment to please codacy 2019-12-31 14:23:01 +08:00
vcptr
78b95d4bc2 fix: default env empty 2019-12-31 13:39:17 +08:00
vcptr
e50afd6e44 trim err msg 2019-12-31 13:29:25 +08:00
vcptr
5ae47d45c2 multiconf with -confdir arg 2019-12-31 11:45:19 +08:00
vcptr
a36631357c add comments to new added code 2019-12-24 01:06:01 +08:00
vcptr
1bb34bfe17 abstract type for conf load func 2019-12-14 23:48:56 +08:00
vcptr
1e76123a4c main loads multiple 2019-12-14 23:48:56 +08:00
vcptr
904db6bd61 mconfig subcommand ready 2019-12-14 23:48:56 +08:00
vcptr
47660bfee2 fix win test error; dont use ReadV on file 2019-11-27 11:24:40 +08:00
vcptr
c060f9f11f fix test read buf 2019-11-27 09:12:02 +08:00
vcptr
afd805c7ba fix session key unexported 2019-11-26 13:30:44 +08:00
vcptr
6ef77246ab add DOH dns client 2019-11-25 15:41:36 +08:00
vcptr
905ac82bb1 more test to common/buf 2019-11-22 17:40:24 +08:00
ghost
8da0a53845 properly propagate Reader errors 2019-11-22 10:11:23 +08:00
ghost
f7abe353df fix ReadBuffer() 2019-11-03 17:37:44 +08:00
fcying
1cc7702c51 check detour tag size 2019-10-27 23:14:08 +08:00