101 Commits
Author SHA1 Message Date
Zakk aaeeb9307b feat(api): attach a machine-readable errorCode and params to FAIL responses
The GUI shows backend error text as is, so errors were never localized.
common.Coded wraps an error with a stable code and scalar parameters;
ResponseError adds "errorCode" and "params" next to the unchanged English
"message" when the chain carries one. Thirty-two user-facing errors are
coded (no server selected, core start failure, port occupied, malformed
link with protocol and detail, subscription fetch failure with host,
server/subscription not found with ids, bad request with the field,
credentials, session, admin, request in progress, GFW list missing,
invalid config, asset download, transparent setup, mux range, custom
inbound fields). logError now keeps the error chain instead of
flattening it. Messages, status codes and control flow are unchanged; the
two strings the GUI matches on stay as they are.

tools_test.go becomes an external test package so the common tests
compile again; its FillEmpty equality assertion, which never ran before,
is skipped with the reason.
2026-09-18 03:52:59 +10:00
Zakk ac79c92d6c fix(service): make API error messages say what was rejected and why
Errors that reach the GUI were written for the log: "ResolveURL failed:
invalid parameters", "httpGetUsingSpecificClient: response is nil",
"LocateServerRaw: invalid TYPE", "bad request", "illegal base64 data at
input byte 18". Reword the messages that can reach a user so each names
the input that was rejected (link scheme, missing password, port, server
id, request field), states the expected form for malformed input, drops
Go function names, keeps the %w chain so errors.Is/As still work, and
never echoes passwords, tokens or full share links (hosts only).
Messages the GUI string-matches ("invalid config", "the last request is
being processed") are unchanged.
2026-09-18 02:53:32 +10:00
ALOKY bea993880c test incremental GeoIP parsing
Cover early exit, fake-IP filtering, IPv6 output, and malformed data.

Signed-off-by: ALOKY <ajm1055@uomustansiriyah.edu.iq>
2026-08-16 15:35:44 +03:00
ALOKY 43b6e55b67 reduce GeoIP parser memory usage
Decode one GeoIP entry at a time and cache successful results.

Signed-off-by: ALOKY <ajm1055@uomustansiriyah.edu.iq>
2026-08-16 15:34:30 +03:00
Markson Joe Hon 47f1462baf feat: init a new for v2raya core and fix a firewall mistake 2026-07-02 13:10:12 +08:00
Markson Pigeonzilla a30c757d07 fix(service): reduce lock contention, improve Windows resilience, fix TinyTun races
ProcessManager.Start() now runs resolv/GFWList checks before acquiring
m.mu and defers afterStart (transparent-proxy setup, DNS, TinyTun,
post-start hook) to after the lock is released, eliminating multi-second
lock holds caused by DNS lookups and external hook commands.

TinyTun:
- Fix cancel/stopping ordering race in startTinyTun: assign the new
  cancel func before clearing the stopping flag so a concurrent
  stopTinyTun always sees the correct cancel
- Resolve proxy-node hostnames concurrently with sync.WaitGroup instead
  of sequentially, reducing config-generation latency
- stopTinyTun now waits up to 5 s for the process to exit via a done
  channel closed by the monitor goroutine after cmd.Wait() returns

Windows service lifecycle:
- cleanupResources enforces a 30 s hard timeout and adds panic recovery
- HTTP router is shut down before the core process on service stop
- router.Run uses an explicit http.Server + Shutdown() for graceful teardown

Connectivity monitor:
- Extend startup grace period to 15 s on Windows (5 s elsewhere)
- Replace fixed 30 s re-check ticker with exponential back-off (30/60/120 s)
- Probe TinyTun availability via TCP dial to the SOCKS5 port instead of HTTP

Platform guards:
- resolv.CheckResolvConf/WriteResolvConf: no-op on non-Linux
- DNS-hijack operations (NewResolvHijacker, HijackResolv, etc.): Linux-only
2026-05-22 15:50:14 +08:00
Markson Hon fd7162e88f feat(service): add custom inbound APIs and strengthen outbound/account flows 2026-05-04 19:07:22 +08:00
Markson HonandMarkson Pigeonzilla fe54c20e54 refactor(tun): modernize legacy route handling and DNS plumbing
Squashed from:
- ede4275e tun: better OS command
- 6a30c17c Tun: better route command
- 4b0f8e94 dns: rewrite DNS module

Co-authored-by: Markson Pigeonzilla <marksonpigeonzilla@bugdows.cn>
2026-03-21 14:59:01 +08:00
Markson Hon aad7e17195 update daeuniverse/outbound 2026-02-04 21:11:26 +08:00
unknown-o 99bd664827 feat(backend): support setting tproxy white ip group 2025-11-05 16:30:24 +00:00
unknown-o c6cb176aa3 feat(backend): add geoip parser 2025-11-05 14:08:11 +00:00
mzz2017 195c84de2c fix(ntp): assume network error as no error 2023-09-02 19:35:21 +08:00
mzz 5c224d3674 fix: port occupation when latency test (#1058) 2023-08-31 23:36:08 +08:00
Farhad Jafari d94e64cadb Add more flow and fix sni (#930)
* Add more flow and fix sni

* Set tcp settings header to none only for TCP network

* Clean v2rayTmpl.go and create antiPollution common

* Set flow only to tls and xtls on vless urls

* Restore back .lock files

* Set host and if it's empty set sni as host
2023-05-09 21:43:18 +08:00
mzz2017 18dcfd94f9 fix: not delete tables rules after http test 2023-03-30 20:54:02 +08:00
mzz2017 e2e7ca9917 fix: ntp should only cache no error result 2022-12-10 22:14:57 +08:00
mzz2017 bcadc53dd3 optimize: increse concurrency of http latency test 2022-12-09 21:34:09 +08:00
mzz2017 030b5c0374 feat: support customized plugin manager 2022-08-03 23:12:29 +08:00
mzz2017 6bb8903758 feat: support multiline base64 encoded subscription. #405 2022-06-18 17:46:41 +08:00
mzz2017 6b757c74b1 optimize: sync time is only required if the protocol is vmess. #564 2022-06-07 09:36:06 +08:00
mzz2017 42f4713aee optimize: remove waiting network 2022-05-28 00:04:56 +08:00
mzz2017 3f4327b0f9 fix: resolv.LookupHost problem and non-A/AAAA/CNAME problem in tproxy #188 2022-04-24 18:50:16 +08:00
mzz2017 b02666bd19 optimize: remove gopeed to avoid 429 2022-03-13 18:05:24 +08:00
高渐离 f8ffdebf52 fix: resolving subscription for line-breaked base64 string (#406) 2022-02-08 18:00:00 +08:00
mzz2017 e99523cf80 fix: xray compatition 2022-01-31 20:04:10 +08:00
mzz2017 1eafeef243 feat(macOS,windows): support system proxy. Thanks @Johnshall #338 2022-01-25 21:18:24 +08:00
mzz2017 eea5e51276 fix: when no addr found, lookup again 2021-12-11 15:34:17 +08:00
Markson Hon a113d4d7a0 Set PreferGo to false (#323) 2021-12-09 13:22:37 +08:00
mzz2017 65bed99656 optimize: expand '~' with user home 2021-10-04 23:19:48 +08:00
mzz2017 403402f0d8 optimize: replace nutsdb with more stable boltdb 2021-10-01 23:56:41 +08:00
mzz2017 c4077f5cc8 fix: slow dns query if all dns is DoH in Advanced DNS 2021-09-27 20:26:33 +08:00
mzz2017 367b15d119 feat: support print connection report 2021-09-24 23:11:42 +08:00
mzz2017 8d43255162 optimize: Split IntranetSharing into IPForward and PortSharing. #266 2021-09-24 11:05:24 +08:00
mzz2017 958cbee014 fix: failed latency test if plugin is needed 2021-09-15 00:39:30 +08:00
mzz2017 8f94446ee5 fix: duplicated servers after update subscriptions 2021-09-10 10:59:24 +08:00
mzz2017 159c542272 fix(transparent proxy): conflict mark 2021-09-07 22:21:37 +08:00
mzz2017 e4dd0eaa76 refactor: server, subscription, api, plugin 2021-09-06 12:32:47 +08:00
mzz2017 c146717c8c fix: empty setting value 2021-09-04 20:02:14 +08:00
mzz2017 abdc0cdf9c fix: gfwlist cannot be updated because of not closed file 2021-09-04 13:16:13 +08:00
mzz2017 e88cdd986a fix: append .exe for windows when search v2ray bin 2021-08-29 21:58:18 +08:00
mzz2017 bd284584b4 feat: try supporting all platforms 2021-08-29 18:02:14 +08:00
mzz2017 cf84860e71 feat: VersionGreaterEqual only judge prefix for unstable and debug version 2021-08-27 18:16:02 +08:00
mzz2017 0d16bd32a7 feat: organize project structure, change log package to beego log and remove v2ray/log package 2021-08-27 14:09:08 +08:00
mzz2017 edea6abb3c feat: grpc support and refine the VLESS-GRPC inbound 2021-08-18 22:35:31 +08:00
mzz2017 17aef44d34 feat: support add a VLESS-GRPC inbound for external incoming connection 2021-08-18 19:46:08 +08:00
mzz2017 9ef01bb403 fix: removed the ipv4 mapping ip from the ipv6 list to prevent 0.0.0.0/0 when parsing CIDR 2021-08-14 21:51:28 +08:00
mzz2017 d0bff832d1 feat: rewrite lru and add unique request id and cache for every requests 2021-08-10 22:18:51 +08:00
mzz2017 d722d15003 feat: add observatory result in GUI 2021-08-06 23:22:40 +08:00
mzz2017 4575a19f51 docs: prompts 2021-08-05 23:02:02 +08:00
mzz2017 8bea500b06 feat: pre-resolve to get more accurate latency 2021-08-05 22:54:40 +08:00