Commit Graph

44 Commits

Author SHA1 Message Date
A1lo
a994bf8b04
chore: fix some errors detected by staticcheck (#3089)
* chore: fix some errors detected by staticcheck

* feat: remove `rand.Seed()` usage for possibly using "fastrand64" runtime to avoid locking

ref: https://pkg.go.dev/math/rand#Seed
2024-03-03 10:52:22 -05:00
Eken Chan
173b03448f transport: add httpupgrade 2024-03-03 10:45:36 -05:00
yuhan6665
fa5d7a255b
Least load balancer (#2999)
* v5: Health Check & LeastLoad Strategy (rebased from 2c5a71490368500a982018a74a6d519c7e121816)

Some changes will be necessary to integrate it into V2Ray

* Update proto

* parse duration conf with time.Parse()

* moving health ping to observatory as a standalone component

* moving health ping to observatory as a standalone component: auto generated file

* add initialization for health ping

* incorporate changes in router implementation

* support principle target output

* add v4 json support for BurstObservatory & fix balancer reference

* update API command

* remove cancelled API

* return zero length value when observer is not found

* remove duplicated targeted dispatch

* adjust test with updated structure

* bug fix for observer

* fix strategy selector

* fix strategy least load

* Fix ticker usage

ticker.Close does not close ticker.C

* feat: Replace default Health Ping URL to HTTPS (#1991)

* fix selectLeastLoad() returns wrong number of nodes (#2083)

* Test: fix leastload strategy unit test

* fix(router): panic caused by concurrent map read and write (#2678)

* Clean up code

---------

Co-authored-by: Jebbs <qjebbs@gmail.com>
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
Co-authored-by: 世界 <i@sekai.icu>
Co-authored-by: Bernd Eichelberger <46166740+4-FLOSS-Free-Libre-Open-Source-Software@users.noreply.github.com>
Co-authored-by: 秋のかえで <autmaple@protonmail.com>
Co-authored-by: Rinka <kujourinka@gmail.com>
2024-02-17 22:51:37 -05:00
nobody
44bb83033f
Add sub-command "-dump" to "run". (#2854)
* Add MarshalToJson().

* Add cmd arg -dump for printing out merged multiple json configs.

---------

Co-authored-by: nobody <nobody@nowhere.mars>
2023-12-29 11:16:48 -05:00
チセ
2da476eef4
Command: Add wg for wireguard key generation (#2794)
* Command: Add `wg` for wireguard key generation

* Command: Merge `x25519` and `wg`
2023-12-11 20:52:10 -05:00
hax0r31337
0ac7da2fc8
WireGuard Inbound (User-space WireGuard server) (#2477)
* feat: wireguard inbound

* feat(command): generate wireguard compatible keypair

* feat(wireguard): connection idle timeout

* fix(wireguard): close endpoint after connection closed

* fix(wireguard): resolve conflicts

* feat(wireguard): set cubic as default cc algorithm in gVisor TUN

* chore(wireguard): resolve conflict

* chore(wireguard): remove redurant code

* chore(wireguard): remove redurant code

* feat: rework server for gvisor tun

* feat: keep user-space tun as an option

* fix: exclude android from native tun build

* feat: auto kernel tun

* fix: build

* fix: regulate function name & fix test
2023-11-17 22:27:17 -05:00
冬花ice
017b56adf5
Recognize .jsonc files automatically (#2398)
Closes https://github.com/XTLS/Xray-core/issues/2399
2023-08-06 06:47:31 +00:00
yuhan6665
c9f517108c Remove mtproto 2023-06-06 23:38:34 -04:00
Hellojack
4a0b45d1ff
Output real private key in x25519 command (#1747) 2023-03-08 13:43:42 +00:00
yuhan6665
9e5bc07bf2
Legends never die (#1725) 2023-03-04 10:39:26 +00:00
RPRX
4d2e2b24d3
THE NEXT FUTURE becomes THE REALITY NOW
Thank @yuhan6665 for testing
2023-02-15 16:07:12 +00:00
nanoda0523
e18b52a5df
Implement WireGuard protocol as outbound (client) (#1344)
* implement WireGuard protocol for Outbound

* upload license

* fix build for openbsd & dragonfly os

* updated wireguard-go

* fix up

* switch to another wireguard fork

* fix

* switch to upstream

* open connection through internet.Dialer (#1)

* use internet.Dialer

* maybe better code

* fix

* real fix

Co-authored-by: nanoda0523 <nanoda0523@users.noreply.github.com>

* fix bugs & add ability to recover during connection reset on UDP over TCP parent protocols

* improve performance

improve performance

* dns lookup endpoint && remove unused code

* interface address fallback

* better code && add config test case

Co-authored-by: nanoda0523 <nanoda0523@users.noreply.github.com>
2022-11-21 20:05:54 -05:00
yuhan6665
f956b142d8 Use protojson for marshal api output 2022-07-15 22:05:40 -04:00
世界
f046feb9ca
Reformat code 2022-05-18 15:29:01 +08:00
yichya
35eb165f63 feat: metrics including pprof, expvars 2022-03-29 00:01:14 -04:00
yuhan6665
abb8ba8b0e
Observatory related fixes (#788)
* fix:observatory not supported by multi-json

* Fix: observatory starts with empty config & fails to close (#957)

* Update strategy_leastping.go (#1019)

* add custom probe URL support for observatory

* add custom probe interval for observer

* apply coding style

* Fix: observatory log & JSON config(#1211)

Co-authored-by: ihotte <ihotte@yeah.net>

* Change default probe url from api.v2fly.org to www.google.com

* Cherry-pick missing code from branch 'dev-advloadblancer-2'

Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: fanyiguan <52657276+fanyiguang@users.noreply.github.com>
Co-authored-by: ihotte <3087168217@qq.com>
Co-authored-by: ihotte <ihotte@yeah.net>
2021-10-26 13:00:31 +08:00
世界
707efd6d12
Add loopback outound 2021-10-22 17:58:37 +08:00
世界
5c366db847
Add observatory / latestPing balancing strategy
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
2021-10-22 17:16:20 +08:00
yuhan6665
acb81ebe3d
Verify peer cert function for better man in the middle prevention (#746)
* verify peer cert function for better man in the middle prevention

* publish cert chain hash generation algorithm

* added calculation of certificate hash as separate command and tlsping, use base64 to represent fingerprint to align with jsonPb

* apply coding style

* added test case for pinned certificates

* refactored cert pin

* pinned cert test

* added json loading of the PinnedPeerCertificateChainSha256

* removed tool to prepare for v5

* Add server cert pinning for Xtls

Change command "xray tls certChainHash" to xray style

Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
2021-10-22 12:38:40 +08:00
yuhan6665
e286cdcaa8
Style: format code by gofumpt (#761) 2021-10-20 00:57:14 +08:00
yuhan6665
a97d45c93a
grammar fix (#745)
Co-authored-by: QxQ <59914293+U-v-U@users.noreply.github.com>
2021-09-30 20:50:46 +08:00
KallyDev
4abf98c1be
Move from deprecated ioutil to os and io packages (#744) 2021-09-29 02:49:34 +08:00
Arthur Morgan
ffc2f7c4e2 Style: format code 2021-09-20 21:00:55 +08:00
秋のかえで
b2d8168284
docs: add common name to the help of tls cert (#435) 2021-03-27 18:32:30 +08:00
秋のかえで
b0e7ad9663
Fix: format flag not working (#410) 2021-03-21 09:13:51 +00:00
RPRX
a0a32ee00d
Add gRPC Transport support (#356)
Co-authored-by: JimhHan <50871214+JimhHan@users.noreply.github.com>
2021-03-14 15:02:07 +00:00
yuhan6665
f50eff5ebb
Add Fake DNS support (#309)
Co-authored-by: Xiaokang Wang <xiaokangwang@outlook.com>
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: kslr <kslrwang@gmail.com>
2021-03-07 04:39:50 +00:00
RPRX
4b97edae74
Fix https://github.com/XTLS/Xray-core/issues/320 2021-03-01 01:29:17 +00:00
Monsoon
1b87264c53
Support loading config from different formats (#228) 2021-02-12 14:12:58 +00:00
RPRX
822afb0cc8
Improve UUID generator
https://github.com/XTLS/Xray-core/issues/158
2021-01-12 18:23:54 +00:00
RPRX
ee15cc253f
Improve configuration detector (cone or symmetric) 2021-01-10 07:50:21 +00:00
秋のかえで
9d4038427d
Enable loading TOML & YAML by confdir (#120) 2021-01-01 12:16:22 +00:00
RPRX
310a938511
VLESS & VMess are not ready to accept FullCone yet 2020-12-30 08:10:26 +00:00
RPRX
ffd8fd1d8a Adjust JSON & TOML & YAML 2020-12-25 18:53:17 +08:00
Monsoon
85619b5a29
Add YAML Support (#86) 2020-12-24 19:30:26 +00:00
秋のかえで
f073456ac0
Add TOML Support (#98) 2020-12-24 19:11:32 +00:00
Jim Han
19ce0e99a5
Config loader returns error instead of directly panic (#80) 2020-12-16 12:35:27 +00:00
RPRX
45f44c401a
Refactor: Optimize Memory Usage At Startup
https://github.com/XTLS/Xray-core/issues/68#issuecomment-745231528
2020-12-15 20:27:18 +08:00
Arthur Morgan
32e7cd80e8
Fix trim package name error (#36) 2020-12-05 00:51:36 +00:00
RPRX
e3575277ba
bytes.Buffer -> strings.Builder 2020-12-05 00:36:16 +00:00
RPRX
7ca55add04
Fix main/commands/all/api/shared.go 2020-12-04 15:35:08 +00:00
RPRX
0a9db2d3d3
Apply JSON format to xray api commands' output 2020-12-04 14:03:07 +00:00
RPRX
16544c18ab v1.1.0 2020-12-04 09:36:16 +08:00
RPRX
c7f7c08ead v1.0.0 2020-11-25 19:01:53 +08:00