new: add hiddifyrpc

This commit is contained in:
Hiddify
2024-03-03 04:15:19 +01:00
parent 0aa2c99599
commit a4b067006a
22 changed files with 3715 additions and 29 deletions

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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")