Add libbox wrapper

This commit is contained in:
世界
2023-02-20 11:07:49 +08:00
parent 86e55c5c1c
commit 222196b182
30 changed files with 829 additions and 100 deletions
+15
View File
@@ -0,0 +1,15 @@
package libbox
import (
"github.com/sagernet/sing-box/option"
E "github.com/sagernet/sing/common/exceptions"
)
func parseConfig(configContent string) (option.Options, error) {
var options option.Options
err := options.UnmarshalJSON([]byte(configContent))
if err != nil {
return option.Options{}, E.Cause(err, "decode config")
}
return options, nil
}