chore(provider): add encryption option for vless#323
Merged
geekdada merged 1 commit intosurgioproject:masterfrom Feb 28, 2026
Merged
chore(provider): add encryption option for vless#323geekdada merged 1 commit intosurgioproject:masterfrom
geekdada merged 1 commit intosurgioproject:masterfrom
Conversation
Signed-off-by: Zoupers <qy@zouper.cn>
✅ Deploy Preview for surgio-documentation ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
@geekdada 能看看吗? |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for the encryption field for VLESS nodes (per the referenced Clash.Meta configuration), ensuring it is validated, preserved when parsing Clash subscriptions, and emitted when generating Clash node definitions.
Changes:
- Extend VLESS node validation schema to include optional
encryption. - Map
encryptionthrough Clash generation (getClashNodes) and Clash subscription parsing (parseClashConfig). - Update unit tests and custom-provider documentation to cover the new field.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/validators/vless.ts | Adds encryption to the VLESS node config validator. |
| src/utils/clash.ts | Emits encryption into generated Clash VLESS proxy objects. |
| src/utils/tests/clash.test.ts | Asserts encryption is included in generated Clash node output. |
| src/provider/ClashProvider.ts | Parses encryption from Clash subscription items into internal VLESS config. |
| src/provider/tests/ClashProvider.test.ts | Asserts encryption is preserved when parsing Clash configs. |
| docs/guide/custom-provider.md | Documents the new optional encryption field for VLESS nodes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| publicKey: 'public-key', | ||
| shortId: 'short-id', // 可选 | ||
| }, | ||
| encryption: "", // 可选 |
There was a problem hiding this comment.
文档示例里把 encryption 写成空字符串(encryption: "")。空字符串对该字段语义不明确,用户照抄后可能产生困惑;建议要么直接省略该字段(体现“可选”),要么给出一个有意义的示例值(例如与 Clash VLESS 配置一致的具体枚举值)。
Suggested change
| encryption: "", // 可选 |
Member
|
感谢贡献代码! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
如链接所示, 有个
encryption属性我们没有支持, 故加上