|
@@ -83,7 +83,7 @@ function decodeBase64OrOriginal(str: string): string {
|
|
function URI_SS(line: string): IProxyShadowsocksConfig {
|
|
function URI_SS(line: string): IProxyShadowsocksConfig {
|
|
// parse url
|
|
// parse url
|
|
let content = line.split("ss://")[1];
|
|
let content = line.split("ss://")[1];
|
|
-
|
|
|
|
|
|
+ content = decodeBase64OrOriginal(content);
|
|
const proxy: IProxyShadowsocksConfig = {
|
|
const proxy: IProxyShadowsocksConfig = {
|
|
name: decodeURIComponent(line.split("#")[1]).trim(),
|
|
name: decodeURIComponent(line.split("#")[1]).trim(),
|
|
type: "ss",
|
|
type: "ss",
|
|
@@ -172,7 +172,7 @@ function URI_SS(line: string): IProxyShadowsocksConfig {
|
|
|
|
|
|
function URI_SSR(line: string): IProxyshadowsocksRConfig {
|
|
function URI_SSR(line: string): IProxyshadowsocksRConfig {
|
|
line = decodeBase64OrOriginal(line.split("ssr://")[1]);
|
|
line = decodeBase64OrOriginal(line.split("ssr://")[1]);
|
|
-
|
|
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
// handle IPV6 & IPV4 format
|
|
// handle IPV6 & IPV4 format
|
|
let splitIdx = line.indexOf(":origin");
|
|
let splitIdx = line.indexOf(":origin");
|
|
if (splitIdx === -1) {
|
|
if (splitIdx === -1) {
|
|
@@ -411,6 +411,7 @@ function URI_VMESS(line: string): IProxyVmessConfig {
|
|
|
|
|
|
function URI_VLESS(line: string): IProxyVlessConfig {
|
|
function URI_VLESS(line: string): IProxyVlessConfig {
|
|
line = line.split("vless://")[1];
|
|
line = line.split("vless://")[1];
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
let isShadowrocket;
|
|
let isShadowrocket;
|
|
let parsed = /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
let parsed = /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
if (!parsed) {
|
|
if (!parsed) {
|
|
@@ -577,6 +578,7 @@ function URI_Trojan(line: string): IProxyTrojanConfig {
|
|
|
|
|
|
function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
|
function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
|
line = line.split(/(hysteria2|hy2):\/\//)[2];
|
|
line = line.split(/(hysteria2|hy2):\/\//)[2];
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
// 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) || [];
|
|
@@ -625,6 +627,7 @@ function URI_Hysteria2(line: string): IProxyHysteria2Config {
|
|
|
|
|
|
function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
|
function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
|
line = line.split(/(hysteria|hy):\/\//)[2];
|
|
line = line.split(/(hysteria|hy):\/\//)[2];
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
let [__, server, ___, port, ____, addons = "", name] =
|
|
let [__, server, ___, port, ____, addons = "", name] =
|
|
/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
/^(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
let portNum = parseInt(`${port}`, 10);
|
|
let portNum = parseInt(`${port}`, 10);
|
|
@@ -720,7 +723,7 @@ function URI_Hysteria(line: string): IProxyHysteriaConfig {
|
|
|
|
|
|
function URI_TUIC(line: string): IProxyTuicConfig {
|
|
function URI_TUIC(line: string): IProxyTuicConfig {
|
|
line = line.split(/tuic:\/\//)[1];
|
|
line = line.split(/tuic:\/\//)[1];
|
|
-
|
|
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
let [__, uuid, password, server, ___, port, ____, addons = "", name] =
|
|
let [__, uuid, password, server, ___, port, ____, addons = "", name] =
|
|
/^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
|
/^(.*?):(.*?)@(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line) || [];
|
|
|
|
|
|
@@ -800,6 +803,7 @@ function URI_TUIC(line: string): IProxyTuicConfig {
|
|
|
|
|
|
function URI_Wireguard(line: string): IProxyWireguardConfig {
|
|
function URI_Wireguard(line: string): IProxyWireguardConfig {
|
|
line = line.split(/(wireguard|wg):\/\//)[2];
|
|
line = line.split(/(wireguard|wg):\/\//)[2];
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
let [__, ___, privateKey, server, ____, port, _____, addons = "", name] =
|
|
let [__, ___, privateKey, server, ____, port, _____, addons = "", name] =
|
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
|
|
|
|
@@ -882,6 +886,7 @@ function URI_Wireguard(line: string): IProxyWireguardConfig {
|
|
|
|
|
|
function URI_HTTP(line: string): IProxyHttpConfig {
|
|
function URI_HTTP(line: string): IProxyHttpConfig {
|
|
line = line.split(/(http|https):\/\//)[2];
|
|
line = line.split(/(http|https):\/\//)[2];
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
|
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
|
|
|
|
@@ -946,6 +951,7 @@ function URI_HTTP(line: string): IProxyHttpConfig {
|
|
|
|
|
|
function URI_SOCKS(line: string): IProxySocks5Config {
|
|
function URI_SOCKS(line: string): IProxySocks5Config {
|
|
line = line.split(/socks5:\/\//)[1];
|
|
line = line.split(/socks5:\/\//)[1];
|
|
|
|
+ line = decodeBase64OrOriginal(line);
|
|
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
|
let [__, ___, auth, server, ____, port, _____, addons = "", name] =
|
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
/^((.*?)@)?(.*?)(:(\d+))?\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
|
|
|
|