Skip to content

Commit d12ccad

Browse files
committed
feat: MMDB 加入 $utils.ipasn
1 parent b435866 commit d12ccad

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.14.409",
3+
"version": "2.14.410",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/utils/geo.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,4 +474,7 @@ export class MMDB {
474474
ipaso(ip) {
475475
return this.asnReader?.asn(ip)?.autonomousSystemOrganization;
476476
}
477+
ipasn(ip) {
478+
return this.asnReader?.asn(ip)?.autonomousSystemNumber;
479+
}
477480
}

scripts/demo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ function operator(proxies = [], targetPlatform, context) {
6767
// getISO, // 获取 ISO 3166-1 alpha-2 代码
6868
// Gist, // Gist 类
6969
// download, // 内部的下载方法, 见 backend/src/utils/download.js
70+
// MMDB, // Node.js 环境 可用于模拟 Surge/Loon 的 $utils.ipasn, $utils.ipaso, $utils.geoip. 具体见 https://t.me/zhetengsha/1269
7071
// }
7172

7273
// 如果只是为了快速修改或者筛选 可以参考 脚本操作支持节点快捷脚本 https://t.me/zhetengsha/970 和 脚本筛选支持节点快捷脚本 https://t.me/zhetengsha/1009

0 commit comments

Comments
 (0)