mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 11:28:59 +08:00
feat: Hysteria2 URI 输入支持 hy2://
This commit is contained in:
parent
c287dcad3b
commit
8b75c11587
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.128",
|
"version": "2.14.129",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -409,10 +409,10 @@ function URI_VLESS() {
|
|||||||
function URI_Hysteria2() {
|
function URI_Hysteria2() {
|
||||||
const name = 'URI Hysteria2 Parser';
|
const name = 'URI Hysteria2 Parser';
|
||||||
const test = (line) => {
|
const test = (line) => {
|
||||||
return /^hysteria2:\/\//.test(line);
|
return /^(hysteria2|hy2):\/\//.test(line);
|
||||||
};
|
};
|
||||||
const parse = (line) => {
|
const parse = (line) => {
|
||||||
line = line.split('hysteria2://')[1];
|
line = line.split(/(hysteria2|hy2):\/\//)[2];
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
let [__, password, server, ___, port, addons, name] =
|
let [__, password, server, ___, port, addons, name] =
|
||||||
/^(.*?)@(.*?)(:(\d+))?\/?\?(.*?)(?:#(.*?))$/.exec(line);
|
/^(.*?)@(.*?)(:(\d+))?\/?\?(.*?)(?:#(.*?))$/.exec(line);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user