mirror of
https://github.com/bestnite/sub2sing-box.git
synced 2025-10-25 08:41:01 +00:00
refactor to compatible with sing-box 1.11
This commit is contained in:
@@ -91,9 +91,9 @@ func ParseHysteria(proxy string) (model.Outbound, error) {
|
||||
},
|
||||
}
|
||||
|
||||
return model.Outbound{Outbound: option.Outbound{
|
||||
return model.Outbound{
|
||||
Type: "hysteria",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
}}, nil
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -99,11 +99,9 @@ func ParseHysteria2(proxy string) (model.Outbound, error) {
|
||||
}
|
||||
|
||||
result := model.Outbound{
|
||||
Outbound: option.Outbound{
|
||||
Type: "hysteria2",
|
||||
Tag: strings.TrimSpace(remarks),
|
||||
Options: outboundOptions,
|
||||
},
|
||||
Type: "hysteria2",
|
||||
Tag: strings.TrimSpace(remarks),
|
||||
Options: outboundOptions,
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
||||
@@ -119,12 +119,11 @@ func ParseShadowsocks(proxy string) (model.Outbound, error) {
|
||||
}
|
||||
|
||||
result := model.Outbound{
|
||||
Outbound: option.Outbound{
|
||||
Type: "shadowsocks",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
},
|
||||
Type: "shadowsocks",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -81,10 +81,8 @@ func ParseSocks(proxy string) (model.Outbound, error) {
|
||||
}
|
||||
|
||||
return model.Outbound{
|
||||
Outbound: option.Outbound{
|
||||
Type: "socks",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
},
|
||||
Type: "socks",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/nitezs/sub2sing-box/constant"
|
||||
"github.com/nitezs/sub2sing-box/model"
|
||||
|
||||
"github.com/sagernet/sing-box/option"
|
||||
"github.com/sagernet/sing/common/json/badoption"
|
||||
)
|
||||
@@ -147,11 +148,11 @@ func ParseTrojan(proxy string) (model.Outbound, error) {
|
||||
}
|
||||
}
|
||||
|
||||
result := model.Outbound{Outbound: option.Outbound{
|
||||
result := model.Outbound{
|
||||
Type: "trojan",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
}}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -156,11 +156,11 @@ func ParseVless(proxy string) (model.Outbound, error) {
|
||||
}
|
||||
}
|
||||
|
||||
result := model.Outbound{Outbound: option.Outbound{
|
||||
result := model.Outbound{
|
||||
Type: "vless",
|
||||
Tag: remarks,
|
||||
Options: outboundOptions,
|
||||
}}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -149,11 +149,9 @@ func ParseVmess(proxy string) (model.Outbound, error) {
|
||||
}
|
||||
|
||||
result := model.Outbound{
|
||||
Outbound: option.Outbound{
|
||||
Type: "vmess",
|
||||
Tag: name,
|
||||
Options: outboundOptions,
|
||||
},
|
||||
Type: "vmess",
|
||||
Tag: name,
|
||||
Options: outboundOptions,
|
||||
}
|
||||
|
||||
return result, nil
|
||||
|
||||
Reference in New Issue
Block a user