1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-28 14:56:33 -04:00
Commit Graph

9 Commits

Author SHA1 Message Date
loyalsoldier
d581fb9c00
Merge branch 'master' into v5 2021-02-17 08:07:12 +08:00
Jebbs
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
秋のかえで
36ba06837f
V5: Add TOML Support (#564) 2021-01-01 22:18:47 +08:00
Jebbs
a5e24544a2
fix commands issues (#492)
* fix api commands output

* remove unused code

* fix convert always has -r

* update merge err to locate failed file
2020-12-20 13:35:52 +08:00
Loyalsoldier
8702812735
Chore: fix lint (#533) 2020-12-20 11:30:31 +08:00
Jebbs
7c1ab06206
v5: Remove v2ctl & wv2ray (#488)
* remove v2ctl, wv2ray
* remove v2ctl, wv2ray build scripts
* remove infra/control/main
* remove !confonly flag
* remove ctlcmd package
* remove Confgi.Override func
* move commands package into main
2020-12-04 22:32:55 +08:00
Jebbs
9367e9b1f2
V5: YAML support (#475)
* yml support

* code optimize

* remove external conf loaders

* update yaml test
code optimize

* code optimize

* fix a typo

* update convert desc
2020-12-03 06:11:24 +08:00
Jebbs
ff59bd37ce
v5: New multi-json loader (#451)
* scalable commands column

* new multi-json loader
For both internal & external json loader

This commit also:
* applies -confdir to other formats, e.g. "yaml" in the future
* multiple assign of -confdir is accepted
* add flag to load confdir recursively
* config loader can have alias name
* json loader also accepts .jsonc
* add merge command
* add help topics for json merge, format loader
* format loaders don't panic

* apply lint style

* add merge test

* merge same tag in array, solve v2fly/discussion#97

* apply lint style

* merge code optimize

* fix merge cmdarg.Arg

* update cmd description

* improve merge logic
* fix zero value overwrite
* fix "null" lost after array merge

* code optimize

* fix merged slices not sorted

* code optimize

* add package doc

* fix a typo
2020-11-28 22:06:03 +08:00
Jebbs
521120d196
go style commands, merge v2ctl commands, v5 oriented (#369)
* go style commands
merge v2ctl commandsw

* migrate go style commands to v2ctl

* fixes & code optimize

* sort the commands

* update commands description

* restore old proto
golang.org proto has removed UnmarshalText, without alternative

* add test command

* remove unused code

* code optimize and fix
* The commit simplifies the run and test commands code,
* Fixes a hidden issue that the format flag not applied in command "v2ray test -format=pb ..."

* fix default loader logic
2020-11-23 23:38:43 +08:00