new: add hiddifyrpc
This commit is contained in:
@@ -2,6 +2,7 @@ package config
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"runtime"
|
||||
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -149,6 +150,7 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
|
||||
AutoRoute: true,
|
||||
StrictRoute: opt.StrictRoute,
|
||||
EndpointIndependentNat: true,
|
||||
GSO: runtime.GOOS != "windows",
|
||||
InboundOptions: option.InboundOptions{
|
||||
SniffEnabled: true,
|
||||
SniffOverrideDestination: true,
|
||||
|
||||
@@ -175,6 +175,9 @@ func patchWarp(base *option.Outbound) error {
|
||||
if base.WireGuardOptions.ServerPort == 0 {
|
||||
base.WireGuardOptions.ServerPort = generateRandomPort()
|
||||
}
|
||||
// if base.WireGuardOptions.Detour == "" {
|
||||
// base.WireGuardOptions.GSO = runtime.GOOS != "windows"
|
||||
// }
|
||||
}
|
||||
if base.Type == C.TypeCustom {
|
||||
if warp, ok := base.CustomOptions["warp"].(map[string]interface{}); ok {
|
||||
|
||||
@@ -29,6 +29,10 @@ func ParseConfig(path string, debug bool) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseConfigContent(string(content), debug)
|
||||
}
|
||||
func ParseConfigContent(contentstr string, debug bool) ([]byte, error) {
|
||||
content := []byte(contentstr)
|
||||
var jsonObj map[string]interface{} = make(map[string]interface{})
|
||||
|
||||
fmt.Printf("Convert using json\n")
|
||||
|
||||
Reference in New Issue
Block a user