Skip to content

Commit

Permalink
feat: 兼容v2rayn 订阅格式
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Oct 31, 2019
1 parent be7d237 commit 8ba4625
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/misc/deprecation.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const DEP001 = 'nowHandler 已不推荐使用,请参考 http://t.tb.cn/6GLiq 尽快更新您的代码';
export const DEP001 = 'nowHandler 已不推荐使用,请参考 http://bit.ly/2q5daCK 尽快更新您的代码';
4 changes: 2 additions & 2 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export const getV2rayNSubscription = async (config: {
const result = configList.map<VmessNodeConfig>(item => {
const json = JSON.parse(fromBase64(item.replace('vmess://', '')));

if (json.v !== '2') {
throw new Error(`暂不支持该订阅类型:${url}`);
if (!json.v || Number(json.v) !== 2) {
throw new Error(`该订阅 ${url} 可能不是一个有效的 V2rayN 订阅。请参考 http://bit.ly/2N4lZ8X 进行排查`);
}

return {
Expand Down

0 comments on commit 8ba4625

Please sign in to comment.