mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 14:34:41 -05:00
🐛 fix #37
This commit is contained in:
parent
7158ad467a
commit
dedbf2bc03
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,3 +6,4 @@ data
|
|||||||
.env
|
.env
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
test
|
test
|
||||||
|
*test.go
|
@ -179,6 +179,10 @@ async function parseInputURL() {
|
|||||||
let hash = url.pathname.substring(url.pathname.lastIndexOf("/s/") + 3);
|
let hash = url.pathname.substring(url.pathname.lastIndexOf("/s/") + 3);
|
||||||
let q = new URLSearchParams();
|
let q = new URLSearchParams();
|
||||||
let password = url.searchParams.get("password");
|
let password = url.searchParams.get("password");
|
||||||
|
if (password === null) {
|
||||||
|
alert("仅可解析加密短链");
|
||||||
|
return;
|
||||||
|
}
|
||||||
q.append("hash", hash);
|
q.append("hash", hash);
|
||||||
q.append("password", password);
|
q.append("password", password);
|
||||||
try {
|
try {
|
||||||
|
@ -72,6 +72,14 @@ func ParseHysteria2(proxy string) (model.Proxy, error) {
|
|||||||
enableTLS := pinSHA256 != ""
|
enableTLS := pinSHA256 != ""
|
||||||
insecureBool := insecure == "1"
|
insecureBool := insecure == "1"
|
||||||
|
|
||||||
|
if remarks == "" {
|
||||||
|
remarksIndex := strings.LastIndex(proxy, "#")
|
||||||
|
if remarksIndex != -1 {
|
||||||
|
remarks = proxy[remarksIndex:]
|
||||||
|
remarks, _ = url.QueryUnescape(remarks)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result := model.Proxy{
|
result := model.Proxy{
|
||||||
Type: "hysteria2",
|
Type: "hysteria2",
|
||||||
Name: remarks,
|
Name: remarks,
|
||||||
|
Loading…
Reference in New Issue
Block a user