Compare commits

...

4 Commits

Author SHA1 Message Date
renovate[bot]
5e29d8f439
chore(deps): update npm dependencies to v19.2.5 2026-04-11 19:30:00 +00:00
Tunglies
a6687a3839
feat(tls): refactor TLS configuration to use static Lazy instance 2026-04-12 03:28:24 +08:00
Tunglies
20fddc5cff
feat: add bytes dependency and optimize buffer handling in test_delay function 2026-04-12 03:26:48 +08:00
Tunglies
6fea76f7e3
feat(core): enable enhanced panic diagnostics and observability
Transitioned panic strategy from 'abort' to 'unwind' and integrated a
global panic hook into the logging framework.

This change allows the application to capture critical failure metadata—
including specific file locations, line numbers, and panic payloads—
persisting them to local logs before exit.

Note: We prioritize troubleshooting capability and long-term stability
at this stage. Reverting to 'panic = abort', `debug = false`,
`strip = true`, `remove split-debuginfo` for peak performance and
minimal binary size will only be considered once the project reaches
a mature state with near-zero community-reported crashes.
2026-04-12 03:26:48 +08:00
7 changed files with 165 additions and 139 deletions

1
Cargo.lock generated
View File

@ -1118,6 +1118,7 @@ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bitflags 2.11.0", "bitflags 2.11.0",
"boa_engine", "boa_engine",
"bytes",
"chrono", "chrono",
"clash-verge-draft", "clash-verge-draft",
"clash-verge-i18n", "clash-verge-i18n",

View File

@ -11,13 +11,14 @@ members = [
resolver = "2" resolver = "2"
[profile.release] [profile.release]
panic = "abort" panic = "unwind"
codegen-units = 1 codegen-units = 1
lto = "thin" lto = "thin"
opt-level = 3 opt-level = 3
debug = false debug = 1
strip = true strip = "none"
overflow-checks = false overflow-checks = false
split-debuginfo = "unpacked"
rpath = false rpath = false
[profile.dev] [profile.dev]

View File

@ -67,8 +67,8 @@
"monaco-editor": "^0.55.1", "monaco-editor": "^0.55.1",
"monaco-yaml": "^5.4.1", "monaco-yaml": "^5.4.1",
"nanoid": "^5.1.7", "nanoid": "^5.1.7",
"react": "19.2.4", "react": "19.2.5",
"react-dom": "19.2.4", "react-dom": "19.2.5",
"react-error-boundary": "6.1.1", "react-error-boundary": "6.1.1",
"react-hook-form": "^7.72.0", "react-hook-form": "^7.72.0",
"react-i18next": "17.0.2", "react-i18next": "17.0.2",

246
pnpm-lock.yaml generated
View File

@ -10,43 +10,43 @@ importers:
dependencies: dependencies:
'@dnd-kit/core': '@dnd-kit/core':
specifier: ^6.3.1 specifier: ^6.3.1
version: 6.3.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 6.3.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@dnd-kit/sortable': '@dnd-kit/sortable':
specifier: ^10.0.0 specifier: ^10.0.0
version: 10.0.0(@dnd-kit/core@6.3.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(react@19.2.4) version: 10.0.0(@dnd-kit/core@6.3.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(react@19.2.5)
'@dnd-kit/utilities': '@dnd-kit/utilities':
specifier: ^3.2.2 specifier: ^3.2.2
version: 3.2.2(react@19.2.4) version: 3.2.2(react@19.2.5)
'@emotion/react': '@emotion/react':
specifier: ^11.14.0 specifier: ^11.14.0
version: 11.14.0(@types/react@19.2.14)(react@19.2.4) version: 11.14.0(@types/react@19.2.14)(react@19.2.5)
'@emotion/styled': '@emotion/styled':
specifier: ^11.14.1 specifier: ^11.14.1
version: 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) version: 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@juggle/resize-observer': '@juggle/resize-observer':
specifier: ^3.4.0 specifier: ^3.4.0
version: 3.4.0 version: 3.4.0
'@monaco-editor/react': '@monaco-editor/react':
specifier: ^4.7.0 specifier: ^4.7.0
version: 4.7.0(monaco-editor@0.55.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 4.7.0(monaco-editor@0.55.1)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@mui/icons-material': '@mui/icons-material':
specifier: ^7.3.9 specifier: ^7.3.9
version: 7.3.9(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) version: 7.3.9(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@mui/lab': '@mui/lab':
specifier: 7.0.0-beta.17 specifier: 7.0.0-beta.17
version: 7.0.0-beta.17(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 7.0.0-beta.17(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@mui/material': '@mui/material':
specifier: ^7.3.9 specifier: ^7.3.9
version: 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@tanstack/react-query': '@tanstack/react-query':
specifier: ^5.96.1 specifier: ^5.96.1
version: 5.96.2(react@19.2.4) version: 5.96.2(react@19.2.5)
'@tanstack/react-table': '@tanstack/react-table':
specifier: ^8.21.3 specifier: ^8.21.3
version: 8.21.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 8.21.3(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@tanstack/react-virtual': '@tanstack/react-virtual':
specifier: ^3.13.23 specifier: ^3.13.23
version: 3.13.23(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 3.13.23(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@tauri-apps/api': '@tauri-apps/api':
specifier: 2.10.1 specifier: 2.10.1
version: 2.10.1 version: 2.10.1
@ -73,7 +73,7 @@ importers:
version: 2.10.1 version: 2.10.1
ahooks: ahooks:
specifier: ^3.9.6 specifier: ^3.9.6
version: 3.9.7(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 3.9.7(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
cidr-block: cidr-block:
specifier: ^2.3.0 specifier: ^2.3.0
version: 2.3.0 version: 2.3.0
@ -82,7 +82,7 @@ importers:
version: 1.11.20 version: 1.11.20
foxact: foxact:
specifier: ^0.3.0 specifier: ^0.3.0
version: 0.3.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 0.3.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
foxts: foxts:
specifier: ^5.3.0 specifier: ^5.3.0
version: 5.4.0 version: 5.4.0
@ -108,26 +108,26 @@ importers:
specifier: ^5.1.7 specifier: ^5.1.7
version: 5.1.7 version: 5.1.7
react: react:
specifier: 19.2.4 specifier: 19.2.5
version: 19.2.4 version: 19.2.5
react-dom: react-dom:
specifier: 19.2.4 specifier: 19.2.5
version: 19.2.4(react@19.2.4) version: 19.2.5(react@19.2.5)
react-error-boundary: react-error-boundary:
specifier: 6.1.1 specifier: 6.1.1
version: 6.1.1(react@19.2.4) version: 6.1.1(react@19.2.5)
react-hook-form: react-hook-form:
specifier: ^7.72.0 specifier: ^7.72.0
version: 7.72.1(react@19.2.4) version: 7.72.1(react@19.2.5)
react-i18next: react-i18next:
specifier: 17.0.2 specifier: 17.0.2
version: 17.0.2(i18next@26.0.3(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2) version: 17.0.2(i18next@26.0.3(typescript@6.0.2))(react-dom@19.2.5(react@19.2.5))(react@19.2.5)(typescript@6.0.2)
react-markdown: react-markdown:
specifier: 10.1.0 specifier: 10.1.0
version: 10.1.0(@types/react@19.2.14)(react@19.2.4) version: 10.1.0(@types/react@19.2.14)(react@19.2.5)
react-router: react-router:
specifier: ^7.13.1 specifier: ^7.13.1
version: 7.14.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4) version: 7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
rehype-raw: rehype-raw:
specifier: ^7.0.0 specifier: ^7.0.0
version: 7.0.0 version: 7.0.0
@ -3101,10 +3101,10 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'} engines: {node: '>=6'}
react-dom@19.2.4: react-dom@19.2.5:
resolution: {integrity: sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==} resolution: {integrity: sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag==}
peerDependencies: peerDependencies:
react: ^19.2.4 react: ^19.2.5
react-error-boundary@6.1.1: react-error-boundary@6.1.1:
resolution: {integrity: sha512-BrYwPOdXi5mqkk5lw+Uvt0ThHx32rCt3BkukS4X23A2AIWDPSGX6iaWTc0y9TU/mHDA/6qOSGel+B2ERkOvD1w==} resolution: {integrity: sha512-BrYwPOdXi5mqkk5lw+Uvt0ThHx32rCt3BkukS4X23A2AIWDPSGX6iaWTc0y9TU/mHDA/6qOSGel+B2ERkOvD1w==}
@ -3164,8 +3164,8 @@ packages:
react: '>=16.6.0' react: '>=16.6.0'
react-dom: '>=16.6.0' react-dom: '>=16.6.0'
react@19.2.4: react@19.2.5:
resolution: {integrity: sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==} resolution: {integrity: sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
readdirp@4.1.2: readdirp@4.1.2:
@ -4331,29 +4331,29 @@ snapshots:
'@biomejs/cli-win32-x64@2.4.10': '@biomejs/cli-win32-x64@2.4.10':
optional: true optional: true
'@dnd-kit/accessibility@3.1.1(react@19.2.4)': '@dnd-kit/accessibility@3.1.1(react@19.2.5)':
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
tslib: 2.8.1 tslib: 2.8.1
'@dnd-kit/core@6.3.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': '@dnd-kit/core@6.3.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@dnd-kit/accessibility': 3.1.1(react@19.2.4) '@dnd-kit/accessibility': 3.1.1(react@19.2.5)
'@dnd-kit/utilities': 3.2.2(react@19.2.4) '@dnd-kit/utilities': 3.2.2(react@19.2.5)
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
tslib: 2.8.1 tslib: 2.8.1
'@dnd-kit/sortable@10.0.0(@dnd-kit/core@6.3.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(react@19.2.4)': '@dnd-kit/sortable@10.0.0(@dnd-kit/core@6.3.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@dnd-kit/core': 6.3.1(react-dom@19.2.4(react@19.2.4))(react@19.2.4) '@dnd-kit/core': 6.3.1(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@dnd-kit/utilities': 3.2.2(react@19.2.4) '@dnd-kit/utilities': 3.2.2(react@19.2.5)
react: 19.2.4 react: 19.2.5
tslib: 2.8.1 tslib: 2.8.1
'@dnd-kit/utilities@3.2.2(react@19.2.4)': '@dnd-kit/utilities@3.2.2(react@19.2.5)':
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
tslib: 2.8.1 tslib: 2.8.1
'@emnapi/core@1.9.2': '@emnapi/core@1.9.2':
@ -4404,17 +4404,17 @@ snapshots:
'@emotion/memoize@0.9.0': {} '@emotion/memoize@0.9.0': {}
'@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4)': '@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@emotion/babel-plugin': 11.13.5 '@emotion/babel-plugin': 11.13.5
'@emotion/cache': 11.14.0 '@emotion/cache': 11.14.0
'@emotion/serialize': 1.3.3 '@emotion/serialize': 1.3.3
'@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.4) '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.5)
'@emotion/utils': 1.4.2 '@emotion/utils': 1.4.2
'@emotion/weak-memoize': 0.4.0 '@emotion/weak-memoize': 0.4.0
hoist-non-react-statics: 3.3.2 hoist-non-react-statics: 3.3.2
react: 19.2.4 react: 19.2.5
optionalDependencies: optionalDependencies:
'@types/react': 19.2.14 '@types/react': 19.2.14
transitivePeerDependencies: transitivePeerDependencies:
@ -4430,16 +4430,16 @@ snapshots:
'@emotion/sheet@1.4.0': {} '@emotion/sheet@1.4.0': {}
'@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4)': '@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@emotion/babel-plugin': 11.13.5 '@emotion/babel-plugin': 11.13.5
'@emotion/is-prop-valid': 1.4.0 '@emotion/is-prop-valid': 1.4.0
'@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.4) '@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.5)
'@emotion/serialize': 1.3.3 '@emotion/serialize': 1.3.3
'@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.4) '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.2.5)
'@emotion/utils': 1.4.2 '@emotion/utils': 1.4.2
react: 19.2.4 react: 19.2.5
optionalDependencies: optionalDependencies:
'@types/react': 19.2.14 '@types/react': 19.2.14
transitivePeerDependencies: transitivePeerDependencies:
@ -4447,9 +4447,9 @@ snapshots:
'@emotion/unitless@0.10.0': {} '@emotion/unitless@0.10.0': {}
'@emotion/use-insertion-effect-with-fallbacks@1.2.0(react@19.2.4)': '@emotion/use-insertion-effect-with-fallbacks@1.2.0(react@19.2.5)':
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
'@emotion/utils@1.4.2': {} '@emotion/utils@1.4.2': {}
@ -4617,70 +4617,70 @@ snapshots:
dependencies: dependencies:
state-local: 1.0.7 state-local: 1.0.7
'@monaco-editor/react@4.7.0(monaco-editor@0.55.1)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': '@monaco-editor/react@4.7.0(monaco-editor@0.55.1)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@monaco-editor/loader': 1.7.0 '@monaco-editor/loader': 1.7.0
monaco-editor: 0.55.1 monaco-editor: 0.55.1
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
'@mui/core-downloads-tracker@7.3.9': {} '@mui/core-downloads-tracker@7.3.9': {}
'@mui/icons-material@7.3.9(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(@types/react@19.2.14)(react@19.2.4)': '@mui/icons-material@7.3.9(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@mui/material': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) '@mui/material': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
react: 19.2.4 react: 19.2.5
optionalDependencies: optionalDependencies:
'@types/react': 19.2.14 '@types/react': 19.2.14
'@mui/lab@7.0.0-beta.17(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': '@mui/lab@7.0.0-beta.17(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@mui/material': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4) '@mui/material': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
'@mui/system': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) '@mui/system': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@mui/types': 7.4.12(@types/react@19.2.14) '@mui/types': 7.4.12(@types/react@19.2.14)
'@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.4) '@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.5)
clsx: 2.1.1 clsx: 2.1.1
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
optionalDependencies: optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.4) '@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.5)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@types/react': 19.2.14 '@types/react': 19.2.14
'@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': '@mui/material@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react-dom@19.2.5(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@mui/core-downloads-tracker': 7.3.9 '@mui/core-downloads-tracker': 7.3.9
'@mui/system': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) '@mui/system': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@mui/types': 7.4.12(@types/react@19.2.14) '@mui/types': 7.4.12(@types/react@19.2.14)
'@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.4) '@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.5)
'@popperjs/core': 2.11.8 '@popperjs/core': 2.11.8
'@types/react-transition-group': 4.4.12(@types/react@19.2.14) '@types/react-transition-group': 4.4.12(@types/react@19.2.14)
clsx: 2.1.1 clsx: 2.1.1
csstype: 3.2.3 csstype: 3.2.3
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
react-is: 19.2.4 react-is: 19.2.4
react-transition-group: 4.4.5(react-dom@19.2.4(react@19.2.4))(react@19.2.4) react-transition-group: 4.4.5(react-dom@19.2.5(react@19.2.5))(react@19.2.5)
optionalDependencies: optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.4) '@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.5)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@types/react': 19.2.14 '@types/react': 19.2.14
'@mui/private-theming@7.3.9(@types/react@19.2.14)(react@19.2.4)': '@mui/private-theming@7.3.9(@types/react@19.2.14)(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.4) '@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.5)
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
optionalDependencies: optionalDependencies:
'@types/react': 19.2.14 '@types/react': 19.2.14
'@mui/styled-engine@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(react@19.2.4)': '@mui/styled-engine@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@emotion/cache': 11.14.0 '@emotion/cache': 11.14.0
@ -4688,25 +4688,25 @@ snapshots:
'@emotion/sheet': 1.4.0 '@emotion/sheet': 1.4.0
csstype: 3.2.3 csstype: 3.2.3
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
optionalDependencies: optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.4) '@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.5)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@mui/system@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4)': '@mui/system@7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@mui/private-theming': 7.3.9(@types/react@19.2.14)(react@19.2.4) '@mui/private-theming': 7.3.9(@types/react@19.2.14)(react@19.2.5)
'@mui/styled-engine': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4))(react@19.2.4) '@mui/styled-engine': 7.3.9(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5))(react@19.2.5)
'@mui/types': 7.4.12(@types/react@19.2.14) '@mui/types': 7.4.12(@types/react@19.2.14)
'@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.4) '@mui/utils': 7.3.9(@types/react@19.2.14)(react@19.2.5)
clsx: 2.1.1 clsx: 2.1.1
csstype: 3.2.3 csstype: 3.2.3
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
optionalDependencies: optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.4) '@emotion/react': 11.14.0(@types/react@19.2.14)(react@19.2.5)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.4))(@types/react@19.2.14)(react@19.2.4) '@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.2.14)(react@19.2.5))(@types/react@19.2.14)(react@19.2.5)
'@types/react': 19.2.14 '@types/react': 19.2.14
'@mui/types@7.4.12(@types/react@19.2.14)': '@mui/types@7.4.12(@types/react@19.2.14)':
@ -4715,14 +4715,14 @@ snapshots:
optionalDependencies: optionalDependencies:
'@types/react': 19.2.14 '@types/react': 19.2.14
'@mui/utils@7.3.9(@types/react@19.2.14)(react@19.2.4)': '@mui/utils@7.3.9(@types/react@19.2.14)(react@19.2.5)':
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@mui/types': 7.4.12(@types/react@19.2.14) '@mui/types': 7.4.12(@types/react@19.2.14)
'@types/prop-types': 15.7.15 '@types/prop-types': 15.7.15
clsx: 2.1.1 clsx: 2.1.1
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
react-is: 19.2.4 react-is: 19.2.4
optionalDependencies: optionalDependencies:
'@types/react': 19.2.14 '@types/react': 19.2.14
@ -4992,22 +4992,22 @@ snapshots:
'@tanstack/query-core@5.96.2': {} '@tanstack/query-core@5.96.2': {}
'@tanstack/react-query@5.96.2(react@19.2.4)': '@tanstack/react-query@5.96.2(react@19.2.5)':
dependencies: dependencies:
'@tanstack/query-core': 5.96.2 '@tanstack/query-core': 5.96.2
react: 19.2.4 react: 19.2.5
'@tanstack/react-table@8.21.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': '@tanstack/react-table@8.21.3(react-dom@19.2.5(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@tanstack/table-core': 8.21.3 '@tanstack/table-core': 8.21.3
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
'@tanstack/react-virtual@3.13.23(react-dom@19.2.4(react@19.2.4))(react@19.2.4)': '@tanstack/react-virtual@3.13.23(react-dom@19.2.5(react@19.2.5))(react@19.2.5)':
dependencies: dependencies:
'@tanstack/virtual-core': 3.13.23 '@tanstack/virtual-core': 3.13.23
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
'@tanstack/table-core@8.21.3': {} '@tanstack/table-core@8.21.3': {}
@ -5344,7 +5344,7 @@ snapshots:
agent-base@9.0.0: {} agent-base@9.0.0: {}
ahooks@3.9.7(react-dom@19.2.4(react@19.2.4))(react@19.2.4): ahooks@3.9.7(react-dom@19.2.5(react@19.2.5))(react@19.2.5):
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
'@types/js-cookie': 3.0.6 '@types/js-cookie': 3.0.6
@ -5352,8 +5352,8 @@ snapshots:
intersection-observer: 0.12.2 intersection-observer: 0.12.2
js-cookie: 3.0.5 js-cookie: 3.0.5
lodash: 4.18.1 lodash: 4.18.1
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
react-fast-compare: 3.2.2 react-fast-compare: 3.2.2
resize-observer-polyfill: 1.5.1 resize-observer-polyfill: 1.5.1
screenfull: 5.2.0 screenfull: 5.2.0
@ -5977,14 +5977,14 @@ snapshots:
dependencies: dependencies:
fetch-blob: 3.2.0 fetch-blob: 3.2.0
foxact@0.3.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4): foxact@0.3.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5):
dependencies: dependencies:
client-only: 0.0.1 client-only: 0.0.1
event-target-bus: 1.0.0 event-target-bus: 1.0.0
server-only: 0.0.1 server-only: 0.0.1
optionalDependencies: optionalDependencies:
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
foxts@5.4.0: {} foxts@5.4.0: {}
@ -6763,37 +6763,37 @@ snapshots:
punycode@2.3.1: {} punycode@2.3.1: {}
react-dom@19.2.4(react@19.2.4): react-dom@19.2.5(react@19.2.5):
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
scheduler: 0.27.0 scheduler: 0.27.0
react-error-boundary@6.1.1(react@19.2.4): react-error-boundary@6.1.1(react@19.2.5):
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
react-fast-compare@3.2.2: {} react-fast-compare@3.2.2: {}
react-hook-form@7.72.1(react@19.2.4): react-hook-form@7.72.1(react@19.2.5):
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
react-i18next@17.0.2(i18next@26.0.3(typescript@6.0.2))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@6.0.2): react-i18next@17.0.2(i18next@26.0.3(typescript@6.0.2))(react-dom@19.2.5(react@19.2.5))(react@19.2.5)(typescript@6.0.2):
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
html-parse-stringify: 3.0.1 html-parse-stringify: 3.0.1
i18next: 26.0.3(typescript@6.0.2) i18next: 26.0.3(typescript@6.0.2)
react: 19.2.4 react: 19.2.5
use-sync-external-store: 1.6.0(react@19.2.4) use-sync-external-store: 1.6.0(react@19.2.5)
optionalDependencies: optionalDependencies:
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
typescript: 6.0.2 typescript: 6.0.2
react-is@16.13.1: {} react-is@16.13.1: {}
react-is@19.2.4: {} react-is@19.2.4: {}
react-markdown@10.1.0(@types/react@19.2.14)(react@19.2.4): react-markdown@10.1.0(@types/react@19.2.14)(react@19.2.5):
dependencies: dependencies:
'@types/hast': 3.0.4 '@types/hast': 3.0.4
'@types/mdast': 4.0.4 '@types/mdast': 4.0.4
@ -6802,7 +6802,7 @@ snapshots:
hast-util-to-jsx-runtime: 2.3.6 hast-util-to-jsx-runtime: 2.3.6
html-url-attributes: 3.0.1 html-url-attributes: 3.0.1
mdast-util-to-hast: 13.2.1 mdast-util-to-hast: 13.2.1
react: 19.2.4 react: 19.2.5
remark-parse: 11.0.0 remark-parse: 11.0.0
remark-rehype: 11.1.2 remark-rehype: 11.1.2
unified: 11.0.5 unified: 11.0.5
@ -6811,24 +6811,24 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
react-router@7.14.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4): react-router@7.14.0(react-dom@19.2.5(react@19.2.5))(react@19.2.5):
dependencies: dependencies:
cookie: 1.1.1 cookie: 1.1.1
react: 19.2.4 react: 19.2.5
set-cookie-parser: 2.7.2 set-cookie-parser: 2.7.2
optionalDependencies: optionalDependencies:
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
react-transition-group@4.4.5(react-dom@19.2.4(react@19.2.4))(react@19.2.4): react-transition-group@4.4.5(react-dom@19.2.5(react@19.2.5))(react@19.2.5):
dependencies: dependencies:
'@babel/runtime': 7.29.2 '@babel/runtime': 7.29.2
dom-helpers: 5.2.1 dom-helpers: 5.2.1
loose-envify: 1.4.0 loose-envify: 1.4.0
prop-types: 15.8.1 prop-types: 15.8.1
react: 19.2.4 react: 19.2.5
react-dom: 19.2.4(react@19.2.4) react-dom: 19.2.5(react@19.2.5)
react@19.2.4: {} react@19.2.5: {}
readdirp@4.1.2: {} readdirp@4.1.2: {}
@ -7171,9 +7171,9 @@ snapshots:
dependencies: dependencies:
punycode: 2.3.1 punycode: 2.3.1
use-sync-external-store@1.6.0(react@19.2.4): use-sync-external-store@1.6.0(react@19.2.5):
dependencies: dependencies:
react: 19.2.4 react: 19.2.5
validator@13.15.35: {} validator@13.15.35: {}

View File

@ -108,6 +108,7 @@ webpki-roots = "1.0"
rust_iso3166 = "0.1.14" rust_iso3166 = "0.1.14"
# Use the git repo until the next release after v2.0.0. # Use the git repo until the next release after v2.0.0.
dark-light = { git = "https://github.com/rust-dark-light/dark-light" } dark-light = { git = "https://github.com/rust-dark-light/dark-light" }
bytes = "1.11.1"
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6" objc2 = "0.6"

View File

@ -100,6 +100,22 @@ impl Logger {
let sidecar_file_writer = self.generate_sidecar_writer()?; let sidecar_file_writer = self.generate_sidecar_writer()?;
*self.sidecar_file_writer.write() = Some(sidecar_file_writer); *self.sidecar_file_writer.write() = Some(sidecar_file_writer);
std::panic::set_hook(Box::new(move |info| {
let payload = info
.payload()
.downcast_ref::<&str>()
.unwrap_or(&"Unknown panic payload");
let location = info
.location()
.map(|loc| format!("{}:{}", loc.file(), loc.line()))
.unwrap_or_else(|| "Unknown location".to_string());
logging!(error, Type::System, "Panic occurred at {}: {}", location, payload);
if let Some(h) = Self::global().handle.lock().as_ref() {
h.flush();
std::thread::sleep(std::time::Duration::from_millis(100));
}
}));
Ok(()) Ok(())
} }

View File

@ -5,9 +5,23 @@ use crate::{
process::AsyncHandler, process::AsyncHandler,
utils, utils,
}; };
use bytes::BytesMut;
use clash_verge_logging::{Type, logging}; use clash_verge_logging::{Type, logging};
use once_cell::sync::Lazy;
use serde_yaml_ng::{Mapping, Value}; use serde_yaml_ng::{Mapping, Value};
use smartstring::alias::String; use smartstring::alias::String;
use std::sync::Arc;
#[allow(clippy::expect_used)]
static TLS_CONFIG: Lazy<Arc<rustls::ClientConfig>> = Lazy::new(|| {
let root_store = rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
let config = rustls::ClientConfig::builder_with_provider(Arc::new(rustls::crypto::ring::default_provider()))
.with_safe_default_protocol_versions()
.expect("Failed to set TLS versions")
.with_root_certificates(root_store)
.with_no_client_auth();
Arc::new(config)
});
/// Restart the Clash core /// Restart the Clash core
pub async fn restart_clash_core() { pub async fn restart_clash_core() {
@ -127,6 +141,7 @@ pub async fn test_delay(url: String) -> anyhow::Result<u32> {
tokio::time::timeout(Duration::from_secs(10), async { tokio::time::timeout(Duration::from_secs(10), async {
let start = Instant::now(); let start = Instant::now();
let mut buf = BytesMut::with_capacity(1024);
if is_https { if is_https {
let stream = match proxy_port { let stream = match proxy_port {
@ -134,22 +149,15 @@ pub async fn test_delay(url: String) -> anyhow::Result<u32> {
let mut s = TcpStream::connect(format!("127.0.0.1:{pp}")).await?; let mut s = TcpStream::connect(format!("127.0.0.1:{pp}")).await?;
s.write_all(format!("CONNECT {host}:{port} HTTP/1.1\r\nHost: {host}:{port}\r\n\r\n").as_bytes()) s.write_all(format!("CONNECT {host}:{port} HTTP/1.1\r\nHost: {host}:{port}\r\n\r\n").as_bytes())
.await?; .await?;
let mut buf = [0u8; 1024]; s.read_buf(&mut buf).await?;
let n = s.read(&mut buf).await?; if !buf.windows(3).any(|w| w == b"200") {
if !std::str::from_utf8(&buf[..n]).unwrap_or("").contains("200") {
return Err(anyhow::anyhow!("Proxy CONNECT failed")); return Err(anyhow::anyhow!("Proxy CONNECT failed"));
} }
s s
} }
None => TcpStream::connect(format!("{host}:{port}")).await?, None => TcpStream::connect(format!("{host}:{port}")).await?,
}; };
let root_store = rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); let connector = tokio_rustls::TlsConnector::from(Arc::clone(&TLS_CONFIG));
let config =
rustls::ClientConfig::builder_with_provider(Arc::new(rustls::crypto::ring::default_provider()))
.with_safe_default_protocol_versions()?
.with_root_certificates(root_store)
.with_no_client_auth();
let connector = tokio_rustls::TlsConnector::from(Arc::new(config));
let server_name = rustls::pki_types::ServerName::try_from(host.as_str()) let server_name = rustls::pki_types::ServerName::try_from(host.as_str())
.map_err(|_| anyhow::anyhow!("Invalid DNS name: {host}"))? .map_err(|_| anyhow::anyhow!("Invalid DNS name: {host}"))?
.to_owned(); .to_owned();
@ -166,7 +174,6 @@ pub async fn test_delay(url: String) -> anyhow::Result<u32> {
), ),
}; };
stream.write_all(req.as_bytes()).await?; stream.write_all(req.as_bytes()).await?;
let mut buf = [0u8; 1024];
let _ = stream.read(&mut buf).await?; let _ = stream.read(&mut buf).await?;
} }