fix: final resolution to network change issue

This commit is contained in:
Hiddify
2024-02-22 09:42:29 +01:00
parent aa825f7fe7
commit 21ac2d1d11
5 changed files with 6 additions and 11 deletions

View File

@@ -123,7 +123,6 @@ func readConfigOptionsAt(path string) (*config.ConfigOptions, error) {
if options.Warp.WireguardConfigStr != "" {
err := json.Unmarshal([]byte(options.Warp.WireguardConfigStr), &options.Warp.WireguardConfig)
if err != nil {
p
return nil, err
}
}

View File

@@ -34,9 +34,9 @@ func ActivateTunnelService(opt ConfigOptions) (bool, error) {
}
func DeactivateTunnelService() (bool, error) {
if !isSupportedOS() {
return true, nil
}
// if !isSupportedOS() {
// return true, nil
// }
go stopTunnelRequest()
return true, nil

View File

@@ -395,10 +395,6 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
//inbound==warp over proxies
//outbound==proxies over warp
if opt.Warp.EnableWarp && (opt.Warp.Mode == "inbound" || opt.Warp.Mode == "outbound") {
fmt.Println("===========================")
fmt.Printf("%+v\n\n", opt.Warp)
fmt.Printf("%+v\n\n", opt.Warp.WireguardConfig)
fmt.Printf("%+v\n\n", opt.Warp.Account)
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 {

2
go.mod
View File

@@ -104,7 +104,7 @@ require (
lukechampine.com/blake3 v1.2.1 // indirect
)
replace github.com/sagernet/sing-box => github.com/hiddify/hiddify-sing-box v1.8.6-0.20240221225110-3adcb8d7e23e
replace github.com/sagernet/sing-box => github.com/hiddify/hiddify-sing-box v1.8.6-0.20240222083623-e9a37dc312df
replace github.com/sagernet/wireguard-go => github.com/hiddify/wireguard-go v0.0.0-20240221205201-947c01ba9168

4
go.sum
View File

@@ -51,8 +51,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
github.com/hiddify-com/wireguard-go v0.0.2-alpha.0.20240220074702-29dc5459810f h1:h9Vsu3eALcx5il3kYVTTZ/la6znEXLrBMJtkRWuUZ+M=
github.com/hiddify-com/wireguard-go v0.0.2-alpha.0.20240220074702-29dc5459810f/go.mod h1:E1qZQpw2IrbRtFpTloTHGfJ2bJc4ZpZRNS497Eq5jCo=
github.com/hiddify/hiddify-sing-box v1.8.6-0.20240221225110-3adcb8d7e23e h1:uE3ZOMI1kbNWhgo6W/U5T9JlEIquT56BwcmpAG3XzK0=
github.com/hiddify/hiddify-sing-box v1.8.6-0.20240221225110-3adcb8d7e23e/go.mod h1:DhXJQn+K+GHW1BtBx/bP47gOe6J4TTiv2nPkBBZQRKA=
github.com/hiddify/hiddify-sing-box v1.8.6-0.20240222083623-e9a37dc312df h1:SOpLm8W1UhdNjS/0u5p70o8cUULa4kb2dJNhuj43WGk=
github.com/hiddify/hiddify-sing-box v1.8.6-0.20240222083623-e9a37dc312df/go.mod h1:DhXJQn+K+GHW1BtBx/bP47gOe6J4TTiv2nPkBBZQRKA=
github.com/hiddify/ray2sing v0.0.0-20240221185915-96fae128815c h1:ZQ7ibzLTTu8CYwgEu6QSFFhX8ZAftv3vG6kn8JuMXY4=
github.com/hiddify/ray2sing v0.0.0-20240221185915-96fae128815c/go.mod h1:zYKnf7EoPqrk7JOMO9BApTXxfH0sva8AKfoFywN7uuA=
github.com/hiddify/wireguard-go v0.0.0-20240221205201-947c01ba9168 h1:IIL2g7fSNAYRP5gtie1boXcPgU1+5cOPv9awhfI8gTo=