Compare commits

..

1 Commits

Author SHA1 Message Date
xream
cae89b82bd feat: 支持 v2ray SOCKS URI 的输入和输出 2025-02-12 03:21:05 +08:00
8 changed files with 10 additions and 59 deletions

View File

@@ -32,7 +32,7 @@ Core functionalities:
example: `socks5+tls://user:pass@ip:port#name`
- [x] URI(SOCKS, SS, SSR, VMess, VLESS, Trojan, Hysteria, Hysteria 2, TUIC v5, WireGuard)
- [x] URI(SS, SSR, VMess, VLESS, Trojan, Hysteria, Hysteria 2, TUIC v5, WireGuard)
- [x] Clash Proxies YAML
- [x] Clash Proxy JSON(single line)
- [x] QX (SS, SSR, VMess, Trojan, HTTP, SOCKS5, VLESS)

View File

@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.16.41",
"version": "2.16.38",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@@ -152,7 +152,6 @@ function URI_SS() {
query = parsed[2];
}
content = Base64.decode(content);
if (query) {
if (/(&|\?)v2ray-plugin=/.test(query)) {
const parsed = query.match(/(&|\?)v2ray-plugin=(.*?)(&|$)/);
@@ -166,8 +165,8 @@ function URI_SS() {
}
content = `${content}${query}`;
}
userInfoStr = content.match(/(^.*)@/)?.[1];
serverAndPortArray = content.match(/@([^/@]*)(\/|$)/);
userInfoStr = content.split('@')[0];
serverAndPortArray = content.match(/@([^/]*)(\/|$)/);
} else if (content.includes('?')) {
const parsed = content.match(/(\?.*)$/);
query = parsed[1];
@@ -839,11 +838,8 @@ function URI_TUIC() {
const parse = (line) => {
line = line.split(/tuic:\/\//)[1];
// eslint-disable-next-line no-unused-vars
let [__, auth, server, port, addons = '', name] =
/^(.*?)@(.*?)(?::(\d+))?\/?(?:\?(.*?))?(?:#(.*?))?$/.exec(line);
auth = decodeURIComponent(auth);
let [uuid, ...passwordParts] = auth.split(':');
let password = passwordParts.join(':');
let [__, uuid, password, server, ___, port, ____, addons = '', name] =
/^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line);
port = parseInt(`${port}`, 10);
if (isNaN(port)) {
port = 443;

View File

@@ -16,7 +16,6 @@ function Base64Encoded() {
const keys = [
'dm1lc3M', // vmess
'c3NyOi8v', // ssr://
'c29ja3M6Ly', // socks://
'dHJvamFu', // trojan
'c3M6Ly', // ss:/
'c3NkOi8v', // ssd://

View File

@@ -59,18 +59,7 @@ function getCollection(req, res) {
res.set('content-type', 'application/json')
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_collection_${name}_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
`attachment; filename="${encodeURIComponent(name)}.json"`,
)
.send(JSON.stringify(collection));
} else {

View File

@@ -209,18 +209,7 @@ function getWholeFile(req, res) {
res.set('content-type', 'application/json')
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_file_${name}_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
`attachment; filename="${encodeURIComponent(name)}.json"`,
)
.send(JSON.stringify(file));
} else {

View File

@@ -27,18 +27,7 @@ export default function register($app) {
res.set('content-type', 'application/json')
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_data_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
'attachment; filename="sub-store.json"',
)
.send(
$.env.isNode

View File

@@ -264,18 +264,7 @@ function getSubscription(req, res) {
res.set('content-type', 'application/json')
.set(
'content-disposition',
`attachment; filename="${encodeURIComponent(
`sub-store_subscription_${name}_${new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
day: 'numeric',
month: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
})
.replace(/\D/g, '')}.json`,
)}"`,
`attachment; filename="${encodeURIComponent(name)}.json"`,
)
.send(JSON.stringify(sub));
} else {