Skip to content

chore(provider): add encryption option for vless#323

Merged
geekdada merged 1 commit intosurgioproject:masterfrom
Zoupers:master
Feb 28, 2026
Merged

chore(provider): add encryption option for vless#323
geekdada merged 1 commit intosurgioproject:masterfrom
Zoupers:master

Conversation

@Zoupers
Copy link
Contributor

@Zoupers Zoupers commented Feb 6, 2026

链接所示, 有个encryption属性我们没有支持, 故加上

Signed-off-by: Zoupers <qy@zouper.cn>
@netlify
Copy link

netlify bot commented Feb 6, 2026

Deploy Preview for surgio-documentation ready!

Name Link
🔨 Latest commit 9ca2d63
🔍 Latest deploy log https://app.netlify.com/projects/surgio-documentation/deploys/698593028375ac0008787eee
😎 Deploy Preview https://deploy-preview-323--surgio-documentation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Zoupers
Copy link
Contributor Author

Zoupers commented Feb 28, 2026

@geekdada 能看看吗?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 encryption through 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: "", // 可选
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档示例里把 encryption 写成空字符串(encryption: "")。空字符串对该字段语义不明确,用户照抄后可能产生困惑;建议要么直接省略该字段(体现“可选”),要么给出一个有意义的示例值(例如与 Clash VLESS 配置一致的具体枚举值)。

Suggested change
encryption: "", // 可选

Copilot uses AI. Check for mistakes.
@geekdada geekdada merged commit a21232c into surgioproject:master Feb 28, 2026
14 checks passed
@geekdada
Copy link
Member

感谢贡献代码!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants