add more logs

This commit is contained in:
Hiddify
2024-02-20 16:23:34 +01:00
parent 84e9e1fa9a
commit 58fc084c4c
3 changed files with 7 additions and 15 deletions

View File

@@ -3,9 +3,7 @@ package config
import (
"encoding/json"
"fmt"
"math/rand"
"net"
"strings"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/option"
@@ -170,10 +168,7 @@ func patchOutbound(base option.Outbound, configOpt ConfigOptions) (*option.Outbo
func patchWarp(base *option.Outbound) error {
if base.Type == C.TypeWireGuard {
splt := strings.Split(base.WireGuardOptions.Server, "*")
host := splt[rand.Intn(len(splt))]
base.WireGuardOptions.Server = host
fmt.Printf("Selected Host is:%s\n", host)
host := base.WireGuardOptions.Server
if host == "default" || host == "random" || host == "auto" || isBlockedDomain(host) {
base.WireGuardOptions.Server = getRandomIP()
}