chore: trojan and singConfigs

This commit is contained in:
cubemaze
2023-08-07 12:23:34 +08:00
parent 45099f6056
commit 85609b41de
5 changed files with 108 additions and 15 deletions

19
core/sing/utils.go Normal file
View File

@@ -0,0 +1,19 @@
package sing
import (
"fmt"
"github.com/InazumaV/V2bX/conf"
"github.com/inazumav/sing-box/option"
"strconv"
)
func processFallback(c *conf.Options, fallbackForALPN map[string]*option.ServerOptions) error {
for k, v := range c.SingOptions.FallBackConfigs.FallBackForALPN {
fallbackPort, err := strconv.Atoi(v.ServerPort)
if err != nil {
return fmt.Errorf("unable to parse fallbackForALPN server port error: %s", err)
}
fallbackForALPN[k] = &option.ServerOptions{Server: v.Server, ServerPort: uint16(fallbackPort)}
}
return nil
}