Commit Graph
1220 Commits
Author SHA1 Message Date
loyalsoldier 3435fc94cb Merge branch 'master' into v5 2021-04-13 14:19:02 +08:00
LoyalsoldierandGitHub 4bbe672ffd Test: add test to avoid the error of missing geoip & geosite (#895) 2021-04-13 10:52:01 +08:00
LoyalsoldierandGitHub 7790d33185 Fix: v2ray.location.asset env not working (#889) 2021-04-12 10:01:30 +08:00
LoyalsoldierandGitHub f71b45f3e7 Chore: fix typos (#878) 2021-04-09 09:47:36 +08:00
LoyalsoldierandGitHub 10ca68f277 Feat: remove geo files from repo & refine tests (#869) 2021-04-07 03:08:03 +08:00
KslrandGitHub 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
loyalsoldier 8ced9c330c Merge branch 'master' into v5 2021-04-03 09:15:19 +08: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
LoyalsoldierandGitHub c80a6df749 Chore: format code (#842) 2021-04-02 20:49:45 +08:00
KslrandGitHub 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
LoyalsoldierandGitHub 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
LoyalsoldierandGitHub 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
DarthVaderandGitHub c71ae9b310 Fix: core panics when zero domain/full type of rule (#786) 2021-03-16 19:07:32 +08:00
loyalsoldier 327ad1a52a Merge branch 'master' into v5 2021-03-16 08:38:04 +08:00
DarthVaderandGitHub 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
LoyalsoldierandGitHub 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
LoyalsoldierandGitHub 88e1e25aa9 Chore: format import using goimports (#780) 2021-03-14 07:09:51 +08:00
LoyalsoldierandGitHub 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
DarthVaderandGitHub 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
LoyalsoldierandGitHub 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
KidandGitHub d2a4e6bc47 Add /opt to assets location (#715) 2021-02-27 17:09:48 +08:00
ebbf31f07e improve commands (#648)
* stat show json refactor
> will show {} since scripts should expect it, its the json style of blank value

* combine statistics commands to one

* code optimize

* fix runtime flag

* remove json indent

* change overridden to override

* api bi -json

* convert stdin support
code optimize

* writeRow() code optimize
add stats tittle
revert back to restartlogger

* api log -restart

* follow log

* codeql

* move -json to shared flags

* flags optimize
* update flag descriptions
* change "-v" of "api bo" to duration
* change "-expire" of "tls cert" to days

* cmds short description optimize

* fix multiple log followers

* Format loader refactor
* "infra/conf/merge" refactor
* "LoadConfig" refactor
* add "infra/conf/mergers"
    * contribute to it will benifit `v2ray run`,`v2ray test`,`v2ray convert`
    * easily add new formats, by just adding a converter like json.FromTOML
* default format auto, to all cmds above
    * auto detect input format
    * mixed formats support
* better stdin behavior
    * don't wait if no content
    * don't use 'stdin:' placeholder
* `v2ray test` now behaves exactly the same with `v2ray run`, including stdin reading

* api ado, adi, rmo, rmi refactor
* support folders to files resolving, mixed formats
* remove remaining 'stdin:' placeholders

* fix tests
* os.Stdin.Stat() behaves different in platforms, removed

* code optimize

Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2021-02-21 23:02:42 +08:00
loyalsoldier d581fb9c00 Merge branch 'master' into v5 2021-02-17 08:07:12 +08:00
LoyalsoldierandGitHub f94dd11a8c Chore: change module name (#677) 2021-02-17 04:31:50 +08:00
loyalsoldier 02a8c41023 Merge branch 'master' into v5 2021-02-16 09:48:41 +08:00
LoyalsoldierandGitHub f98944c9e0 Chore: update protobuf (#670) 2021-02-11 14:57:20 +08:00
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
database64128andGitHub 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
JebbsandGitHub 2c5a714903 v5: Health Check & LeastLoad Strategy (#589)
* generate .pb.go

* health checker conf

* check logic

* implement ping

* fix check interval

* improve check results

* health check on add outbounds

* fix tests

* fix ping handler

* fix min rtt < 0

* random alive

* fix check all on add outbounds

* least load strategy

* conf codes optimize

* improve least load strategy

* improve health check on AddOutboundHandler

* cleanup results with scheduler
code optimize

* health ping timeout default 5s

* remove config of health ping round
round 1 seems to be good enough

* fix TestSimpleBalancer

* add TestLeastLoadBalancer

* add todos

* lint and test fix

* balancer fallback

* api health stats command

* add hc cmd to perform health checks
* rename 'health stats' cmd to hci
* many code optimizations

* fix typo

* select none if no match for baselines only config
> prev 'select 1' behavior can achieved by baselines+expected=1

* add LeastLoadStrategy tests

* don't select alive on no match, go to fallback

* api hci refactor
* more detailed info
* ready for future new strategies

* apply lint style

* refactor: strategies don't need ref of balancer

* change check interval unit to seconds
> to reduce influence caused by what is described by new added FIXME

* fix test

* RouterService->RoutingService

* Revert "generate .pb.go"

This reverts commit 0e6fa1be889470d0ad9692f7279da45c030e1919.

* make checks distributed
> but `api hc` is the exception

* BalancingStrategy interface optimize

* fix random selects unchecked

* upgrade cmd hci to bi & rename hc to bc
* bi shows all balancers, while hci shows only heath-check-enabled ones
* shows more info

* fix test

* api bi sort output

* update according to review

* remove checks on add outbound

* refactor: move health checker inside to strategy
* enables rounds setting for health ping
* restore the random behavior, no ping, no pick alive

> if future strategy based on HealthPing, just embed it like what LeastLoad does

* apply lint style

* code optimize

* fix typo

* update desc of bc bi

* ping with head
code optimize

* force rouds to 1 if checks not distributed

* leatload: select by standard deviations

* health ping refactor
* continuously applying results
* config is easier to understand
* checker interfaces simplifying

* add maxRTT config to filter away high delay nodes

* apply lint

* cost for leastload

* api bo to override balancer selecting

* fix health ping statistics & fix test

* check connectivity if ping fail

* add tolerance setting & more detailed bi output

* fix connectivity check

* optimize bi output

* should not put results when network is down

* fixes @_@

* mux optimize

* remove pause option of selecting overriding
> it causes data racing

* update bo desc

* fix potential racing

* simplify locking
* switch sync.Mutex to avoid potential racing
* add more tests
* code optimize

* code optimize

* fix connectivity check when url not set
2021-01-30 08:31:11 +08:00
刘志龙andGitHub 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