mirror of
https://github.com/bestnite/sub2sing-box.git
synced 2025-07-05 09:52:33 +08:00
update: template可以接受网络文件
This commit is contained in:
@ -5,8 +5,8 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2sing-box/internal"
|
||||
"sub2sing-box/internal/model"
|
||||
"sub2sing-box/internal/util"
|
||||
)
|
||||
|
||||
func ParseShadowsocks(proxy string) (model.Proxy, error) {
|
||||
@ -18,7 +18,7 @@ func ParseShadowsocks(proxy string) (model.Proxy, error) {
|
||||
return model.Proxy{}, errors.New("invalid ss Url")
|
||||
}
|
||||
if !strings.Contains(parts[0], ":") {
|
||||
decoded, err := internal.DecodeBase64(parts[0])
|
||||
decoded, err := util.DecodeBase64(parts[0])
|
||||
if err != nil {
|
||||
return model.Proxy{}, errors.New("invalid ss Url" + err.Error())
|
||||
}
|
||||
|
@ -6,15 +6,15 @@ import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sub2sing-box/internal"
|
||||
"sub2sing-box/internal/model"
|
||||
"sub2sing-box/internal/util"
|
||||
)
|
||||
|
||||
func ParseVmess(proxy string) (model.Proxy, error) {
|
||||
if !strings.HasPrefix(proxy, "vmess://") {
|
||||
return model.Proxy{}, errors.New("invalid vmess url")
|
||||
}
|
||||
base64, err := internal.DecodeBase64(strings.TrimPrefix(proxy, "vmess://"))
|
||||
base64, err := util.DecodeBase64(strings.TrimPrefix(proxy, "vmess://"))
|
||||
if err != nil {
|
||||
return model.Proxy{}, errors.New("invalid vmess url" + err.Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user