♻️ Refactor

This commit is contained in:
2024-10-03 01:24:54 +08:00
parent 573d0056d0
commit 3729675031
32 changed files with 284 additions and 829 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/sagernet/sing-box/option"
)
func ParseHysteria(proxy string) (model.Outbound, error) {
@@ -70,11 +71,11 @@ func ParseHysteria(proxy string) (model.Outbound, error) {
}
remarks = strings.TrimSpace(remarks)
return model.Outbound{
return model.Outbound{Outbound: option.Outbound{
Type: "hysteria",
Tag: remarks,
HysteriaOptions: model.HysteriaOutboundOptions{
ServerOptions: model.ServerOptions{
HysteriaOptions: option.HysteriaOutboundOptions{
ServerOptions: option.ServerOptions{
Server: server,
ServerPort: port,
},
@@ -82,14 +83,14 @@ func ParseHysteria(proxy string) (model.Outbound, error) {
Down: downmbps,
Auth: []byte(auth),
Obfs: obfs,
Network: protocol,
OutboundTLSOptionsContainer: model.OutboundTLSOptionsContainer{
TLS: &model.OutboundTLSOptions{
Network: option.NetworkList(protocol),
OutboundTLSOptionsContainer: option.OutboundTLSOptionsContainer{
TLS: &option.OutboundTLSOptions{
Enabled: true,
Insecure: insecureBool,
ALPN: alpn,
},
},
},
}, nil
}}, nil
}