fix: bugs and issues

This commit is contained in:
Hiddify
2024-03-09 21:07:15 +01:00
parent d05deef499
commit 8ecd0d9644
13 changed files with 79 additions and 60 deletions

View File

@@ -394,13 +394,16 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
var outbounds []option.Outbound
var tags []string
OutboundMainProxyTag = OutboundSelectTag
if opt.Warp.EnableWarp && (opt.Warp.Mode == WarpOverProxy || opt.Warp.Mode == ProxyOverWarp) {
//inbound==warp over proxies
//outbound==proxies over warp
if opt.Warp.EnableWarp && (opt.Warp.Mode == "inbound" || opt.Warp.Mode == "outbound") {
out, err := generateWarpSingbox(opt.Warp.WireguardConfig.ToWireguardConfig(), opt.Warp.CleanIP, opt.Warp.CleanPort, opt.Warp.FakePackets, opt.Warp.FakePacketSize, opt.Warp.FakePacketDelay)
if err != nil {
return nil, fmt.Errorf("failed to generate warp config: %v", err)
}
out.Tag = "Hiddify Warp ✅"
if opt.Warp.Mode == WarpOverProxy {
if opt.Warp.Mode == "inbound" {
out.WireGuardOptions.Detour = OutboundURLTestTag
OutboundMainProxyTag = out.Tag
} else {
@@ -531,7 +534,7 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
}
func patchHiddifyWarpFromConfig(out option.Outbound, opt ConfigOptions) option.Outbound {
if opt.Warp.EnableWarp && opt.Warp.Mode == ProxyOverWarp {
if opt.Warp.EnableWarp && opt.Warp.Mode == "outbound" {
if out.DirectOptions.Detour == "" {
out.DirectOptions.Detour = "Hiddify Warp ✅"
}