new: Big Change, Add support for Extensions 😍

This commit is contained in:
hiddify
2024-09-28 20:31:38 +02:00
parent 1f485e1193
commit 3a508b7929
44 changed files with 8946 additions and 619 deletions

View File

@@ -6,6 +6,24 @@ import (
"github.com/hiddify/hiddify-core/cmd"
)
type UpdateRequest struct {
Description string `json:"description,omitempty"`
PrivatePods bool `json:"private_pods"`
OperatingMode string `json:"operating_mode,omitempty"`
ActivationState string `json:"activation_state,omitempty"`
}
func main() {
cmd.ParseCli(os.Args[1:])
// var request UpdateRequest
// // jsonTag, err2 := validation.ErrorFieldName(&request, &request.OperatingMode)
// jsonTag, err2 := request.ValName(&request.OperatingMode)
// fmt.Println(jsonTag, err2)
// RegisterExtension("com.example.extension", NewExampleExtension())
// ex := extensionsMap["com.example.extension"].(*Extension[struct])
// fmt.Println(NewExampleExtension().Get())
// fmt.Println(ex.Get())
}

2
cmd.sh Normal file → Executable file
View File

@@ -1,3 +1,3 @@
TAGS=with_gvisor,with_quic,with_wireguard,with_ech,with_utls,with_clash_api,with_grpc
# TAGS=with_dhcp,with_low_memory,with_conntrack
go run --tags $TAGS ./cmd $@
go run --tags $TAGS ./cli $@

59
cmd/cmd_instance.go Normal file
View File

@@ -0,0 +1,59 @@
package cmd
import (
"os"
"os/signal"
"syscall"
v2 "github.com/hiddify/hiddify-core/v2"
"github.com/sagernet/sing-box/log"
"github.com/spf13/cobra"
)
var commandInstance = &cobra.Command{
Use: "instance",
Short: "instance",
Args: cobra.OnlyValidArgs,
Run: func(cmd *cobra.Command, args []string) {
hiddifySetting := defaultConfigs
if hiddifySettingPath != "" {
hiddifySetting2, err := v2.ReadHiddifyOptionsAt(hiddifySettingPath)
if err != nil {
log.Fatal(err)
}
hiddifySetting = *hiddifySetting2
}
instance, err := v2.RunInstanceString(&hiddifySetting, configPath)
if err != nil {
log.Fatal(err)
}
defer instance.Close()
ping, err := instance.PingAverage("http://cp.cloudflare.com", 4)
if err != nil {
// log.Fatal(err)
}
log.Info("Average Ping to Cloudflare : ", ping, "\n")
for i := 1; i <= 4; i++ {
ping, err := instance.PingCloudflare()
if err != nil {
log.Warn(i, " Error ", err, "\n")
} else {
log.Info(i, " Ping time: ", ping, " ms\n")
}
}
log.Info("Instance is running on port socks5://127.0.0.1:", instance.ListenPort, "\n")
log.Info("Press Ctrl+C to exit\n")
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
<-sigChan
log.Info("CTRL+C recived-->stopping\n")
instance.Close()
},
}
func init() {
mainCommand.AddCommand(commandInstance)
addHConfigFlags(commandInstance)
}

View File

@@ -23,6 +23,5 @@ func init() {
}
func runCommand(cmd *cobra.Command, args []string) {
v2.RunStandalone(hiddifySettingPath, configPath, defaultConfigs)
}

141
cmd/cmd_temp.go Normal file
View File

@@ -0,0 +1,141 @@
package cmd
import (
"context"
"fmt"
"io"
"math/rand"
"net/http"
"net/netip"
"time"
"github.com/hiddify/hiddify-core/common"
"github.com/hiddify/hiddify-core/extension_repository/cleanip_scanner"
"github.com/spf13/cobra"
"golang.org/x/net/proxy"
)
var commandTemp = &cobra.Command{
Use: "temp",
Short: "temp",
Args: cobra.MaximumNArgs(2),
Run: func(cmd *cobra.Command, args []string) {
// fmt.Printf("Ping time: %d ms\n", Ping())
scanner := cleanip_scanner.NewScannerEngine(&cleanip_scanner.ScannerOptions{
UseIPv4: true,
UseIPv6: common.CanConnectIPv6(),
MaxDesirableRTT: 500 * time.Millisecond,
IPQueueSize: 4,
IPQueueTTL: 10 * time.Second,
ConcurrentPings: 10,
// MaxDesirableIPs: e.count,
CidrList: cleanip_scanner.DefaultCFRanges(),
PingFunc: func(ip netip.Addr) (cleanip_scanner.IPInfo, error) {
fmt.Printf("Ping: %s\n", ip.String())
return cleanip_scanner.IPInfo{
AddrPort: netip.AddrPortFrom(ip, 80),
RTT: time.Duration(rand.Intn(1000)),
CreatedAt: time.Now(),
}, nil
},
},
)
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
defer cancel()
scanner.Run(ctx)
t := time.NewTicker(1 * time.Second)
defer t.Stop()
for {
ipList := scanner.GetAvailableIPs(false)
if len(ipList) > 1 {
// e.result = ""
for i := 0; i < 2; i++ {
// result = append(result, ipList[i])
// e.result = e.result + ipList[i].AddrPort.String() + "\n"
fmt.Printf("%d %s\n", ipList[i].RTT, ipList[i].AddrPort.String())
}
return
}
select {
case <-ctx.Done():
// Context is done
return
case <-t.C:
// Prevent the loop from spinning too fast
continue
}
}
},
}
func init() {
mainCommand.AddCommand(commandTemp)
}
func GetContent(url string) (string, error) {
return ContentFromURL("GET", url, 10*time.Second)
}
func ContentFromURL(method string, url string, timeout time.Duration) (string, error) {
if method == "" {
return "", fmt.Errorf("empty method")
}
if url == "" {
return "", fmt.Errorf("empty url")
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
return "", err
}
dialer, err := proxy.SOCKS5("tcp", "127.0.0.1:12334", nil, proxy.Direct)
if err != nil {
return "", err
}
transport := &http.Transport{
Dial: dialer.Dial,
}
client := &http.Client{
Transport: transport,
Timeout: timeout,
}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent {
return "", fmt.Errorf("request failed with status code: %d", resp.StatusCode)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
if body == nil {
return "", fmt.Errorf("empty body")
}
return string(body), nil
}
func Ping() int {
startTime := time.Now()
_, err := ContentFromURL("HEAD", "https://cp.cloudflare.com", 4*time.Second)
if err != nil {
return -1
}
duration := time.Since(startTime)
return int(duration.Milliseconds())
}

174
common/cache.go Normal file
View File

@@ -0,0 +1,174 @@
package common
import (
"context"
"encoding/json"
"errors"
"log"
"os"
"time"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/bbolt"
bboltErrors "github.com/sagernet/bbolt/errors"
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/sing/service/filemanager"
)
var (
Storage = New(context.Background(), option.CacheFileOptions{})
bucketExtension = []byte("extension")
bucketHiddify = []byte("hiddify")
bucketNameList = []string{
string(bucketExtension),
string(bucketHiddify),
}
)
type CacheFile struct {
ctx context.Context
path string
cacheID []byte
DB *bbolt.DB
}
func New(ctx context.Context, options option.CacheFileOptions) *CacheFile {
var path string
if options.Path != "" {
path = options.Path
} else {
path = "hiddify.db"
}
var cacheIDBytes []byte
if options.CacheID != "" {
cacheIDBytes = append([]byte{0}, []byte(options.CacheID)...)
}
cache := &CacheFile{
ctx: ctx,
path: filemanager.BasePath(ctx, path),
cacheID: cacheIDBytes,
}
err := cache.start()
if err != nil {
log.Panic(err)
}
return cache
}
func (c *CacheFile) start() error {
const fileMode = 0o666
options := bbolt.Options{Timeout: time.Second
}
var (
db *bbolt.DB
err error
)
for i := 0; i < 10; i++ {
db, err = bbolt.Open(c.path, fileMode, &options)
if err == nil {
break
}
if errors.Is(err, bboltErrors.ErrTimeout) {
continue
}
if E.IsMulti(err, bboltErrors.ErrInvalid, bboltErrors.ErrChecksum, bboltErrors.ErrVersionMismatch) {
rmErr := os.Remove(c.path)
if rmErr != nil {
return err
}
}
time.Sleep(100 * time.Millisecond)
}
if err != nil {
return err
}
err = filemanager.Chown(c.ctx, c.path)
if err != nil {
db.Close()
return E.Cause(err, "platform chown")
}
err = db.Batch(func(tx *bbolt.Tx) error {
return tx.ForEach(func(name []byte, b *bbolt.Bucket) error {
if name[0] == 0 {
return b.ForEachBucket(func(k []byte) error {
bucketName := string(k)
if !(common.Contains(bucketNameList, bucketName)) {
_ = b.DeleteBucket(name)
}
return nil
})
} else {
bucketName := string(name)
if !(common.Contains(bucketNameList, bucketName)) {
_ = tx.DeleteBucket(name)
}
}
return nil
})
})
if err != nil {
db.Close()
return err
}
c.DB = db
return nil
}
func (c *CacheFile) bucket(t *bbolt.Tx, key []byte) *bbolt.Bucket {
if c.cacheID == nil {
return t.Bucket(key)
}
bucket := t.Bucket(c.cacheID)
if bucket == nil {
return nil
}
return bucket.Bucket(key)
}
func (c *CacheFile) createBucket(t *bbolt.Tx, key []byte) (*bbolt.Bucket, error) {
if c.cacheID == nil {
return t.CreateBucketIfNotExists(key)
}
bucket, err := t.CreateBucketIfNotExists(c.cacheID)
if bucket == nil {
return nil, err
}
return bucket.CreateBucketIfNotExists(key)
}
func (c *CacheFile) GetExtensionData(extension_id string, default_value any) error {
err := c.DB.View(func(t *bbolt.Tx) error {
bucket := c.bucket(t, bucketExtension)
if bucket == nil {
return os.ErrNotExist
}
setBinary := bucket.Get([]byte(extension_id))
if len(setBinary) == 0 {
return os.ErrInvalid
}
return json.Unmarshal(setBinary, &default_value)
})
return err
}
func (c *CacheFile) SaveExtensionData(extension_id string, data any) error {
return c.DB.Batch(func(t *bbolt.Tx) error {
bucket, err := c.createBucket(t, bucketExtension)
if err != nil {
return err
}
// Assuming T implements MarshalBinary
setBinary, err := json.MarshalIndent(data, " ", "")
if err != nil {
return err
}
return bucket.Put([]byte(extension_id), setBinary)
})
}

25
common/utils.go Normal file
View File

@@ -0,0 +1,25 @@
package common
import (
"net"
"net/netip"
"time"
)
func CanConnectIPv6Addr(remoteAddr netip.AddrPort) bool {
dialer := net.Dialer{
Timeout: 1 * time.Second,
}
conn, err := dialer.Dial("tcp6", remoteAddr.String())
if err != nil {
return false
}
defer conn.Close()
return true
}
func CanConnectIPv6() bool {
return CanConnectIPv6Addr(netip.MustParseAddrPort("[2001:4860:4860::8888]:80"))
}

View File

@@ -287,7 +287,7 @@ func setClashAPI(options *option.Options, opt *HiddifyOptions) {
func setLog(options *option.Options, opt *HiddifyOptions) {
options.Log = &option.LogOptions{
Level: opt.LogLevel,
Output: "box.log",
Output: opt.LogFile,
Disabled: false,
Timestamp: true,
DisableColor: true,

View File

@@ -8,6 +8,7 @@ import (
type HiddifyOptions struct {
EnableFullConfig bool `json:"enable-full-config"`
LogLevel string `json:"log-level"`
LogFile string `json:"log-file"`
EnableClashApi bool `json:"enable-clash-api"`
ClashApiPort uint16 `json:"clash-api-port"`
ClashApiSecret string `json:"web-secret"`
@@ -106,8 +107,8 @@ func DefaultHiddifyOptions() *HiddifyOptions {
InboundOptions: InboundOptions{
EnableTun: false,
SetSystemProxy: false,
MixedPort: 2334,
TProxyPort: 2335,
MixedPort: 12334,
TProxyPort: 12335,
LocalDnsPort: 16450,
MTU: 9000,
StrictRoute: true,
@@ -124,10 +125,12 @@ func DefaultHiddifyOptions() *HiddifyOptions {
BypassLAN: false,
AllowConnectionFromLAN: false,
},
LogLevel: "warn",
LogLevel: "warn",
// LogFile: "/dev/null",
LogFile: "box.log",
Region: "other",
EnableClashApi: true,
ClashApiPort: 6756,
ClashApiPort: 16756,
ClashApiSecret: "",
// GeoIPPath: "geoip.db",
// GeoSitePath: "geosite.db",

View File

@@ -31,6 +31,19 @@ func ParseConfig(path string, debug bool) ([]byte, error) {
return ParseConfigContent(string(content), debug, nil, false)
}
func ParseConfigContentToOptions(contentstr string, debug bool, configOpt *HiddifyOptions, fullConfig bool) (*option.Options, error) {
content, err := ParseConfigContent(contentstr, debug, configOpt, fullConfig)
if err != nil {
return nil, err
}
var options option.Options
err = json.Unmarshal(content, &options)
if err != nil {
return nil, err
}
return &options, nil
}
func ParseConfigContent(contentstr string, debug bool, configOpt *HiddifyOptions, fullConfig bool) ([]byte, error) {
if configOpt == nil {
configOpt = DefaultHiddifyOptions()

View File

@@ -9,6 +9,7 @@ import (
"strings"
"github.com/bepass-org/warp-plus/warp"
"github.com/hiddify/hiddify-core/common"
C "github.com/sagernet/sing-box/constant"
// "github.com/bepass-org/wireguard-go/warp"
@@ -189,8 +190,10 @@ func patchWarp(base *option.Outbound, configOpt *HiddifyOptions, final bool, sta
rndDomain := strings.ToLower(generateRandomString(20))
staticIpsDns[rndDomain] = []string{}
if host != "auto4" {
randomIpPort, _ := warp.RandomWarpEndpoint(false, true)
staticIpsDns[rndDomain] = append(staticIpsDns[rndDomain], randomIpPort.Addr().String())
if host == "auto6" || common.CanConnectIPv6() {
randomIpPort, _ := warp.RandomWarpEndpoint(false, true)
staticIpsDns[rndDomain] = append(staticIpsDns[rndDomain], randomIpPort.Addr().String())
}
}
if host != "auto6" {
randomIpPort, _ := warp.RandomWarpEndpoint(true, false)

View File

@@ -1,54 +1,72 @@
package extension
import (
"fmt"
"log"
"github.com/hiddify/hiddify-core/extension/ui_elements"
"github.com/hiddify/hiddify-core/common"
"github.com/hiddify/hiddify-core/config"
"github.com/hiddify/hiddify-core/extension/ui"
pb "github.com/hiddify/hiddify-core/hiddifyrpc"
)
var (
extensionsMap = make(map[string]*Extension)
extensionStatusMap = make(map[string]bool)
"github.com/jellydator/validation"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
)
type Extension interface {
GetTitle() string
GetDescription() string
GetUI() ui_elements.Form
GetUI() ui.Form
SubmitData(data map[string]string) error
Cancel() error
Stop() error
UpdateUI(form ui_elements.Form) error
UpdateUI(form ui.Form) error
BeforeAppConnect(hiddifySettings *config.HiddifyOptions, singconfig *option.Options) error
StoreData()
init(id string)
getQueue() chan *pb.ExtensionResponse
getId() string
}
type BaseExtension struct {
type Base[T any] struct {
id string
// responseStream grpc.ServerStreamingServer[pb.ExtensionResponse]
queue chan *pb.ExtensionResponse
Data T
}
// func (b *BaseExtension) mustEmbdedBaseExtension() {
// func (b *Base) mustEmbdedBaseExtension() {
// }
func (b *BaseExtension) init(id string) {
b.id = id
b.queue = make(chan *pb.ExtensionResponse, 1)
func (b *Base[T]) BeforeAppConnect(hiddifySettings *config.HiddifyOptions, singconfig *option.Options) error {
return nil
}
func (b *BaseExtension) getQueue() chan *pb.ExtensionResponse {
func (b *Base[T]) StoreData() {
common.Storage.SaveExtensionData(b.id, &b.Data)
}
func (b *Base[T]) init(id string) {
b.id = id
b.queue = make(chan *pb.ExtensionResponse, 1)
common.Storage.GetExtensionData(b.id, &b.Data)
}
func (b *Base[T]) getQueue() chan *pb.ExtensionResponse {
return b.queue
}
func (b *BaseExtension) getId() string {
func (b *Base[T]) getId() string {
return b.id
}
func (p *BaseExtension) UpdateUI(form ui_elements.Form) error {
func (e *Base[T]) ShowMessage(title string, msg string) error {
return e.ShowDialog(ui.Form{
Title: title,
Description: msg,
Buttons: []string{ui.Button_Ok},
})
}
func (p *Base[T]) UpdateUI(form ui.Form) error {
p.queue <- &pb.ExtensionResponse{
ExtensionId: p.id,
Type: pb.ExtensionResponseType_UPDATE_UI,
@@ -57,7 +75,7 @@ func (p *BaseExtension) UpdateUI(form ui_elements.Form) error {
return nil
}
func (p *BaseExtension) ShowDialog(form ui_elements.Form) error {
func (p *Base[T]) ShowDialog(form ui.Form) error {
p.queue <- &pb.ExtensionResponse{
ExtensionId: p.id,
Type: pb.ExtensionResponseType_SHOW_DIALOG,
@@ -67,20 +85,22 @@ func (p *BaseExtension) ShowDialog(form ui_elements.Form) error {
return nil
}
func RegisterExtension(id string, extension Extension) error {
if _, ok := extensionsMap[id]; ok {
err := fmt.Errorf("Extension with ID %s already exists", id)
log.Fatal(err)
return err
func (base *Base[T]) ValName(fieldPtr interface{}) string {
val, err := validation.ErrorFieldName(&base.Data, fieldPtr)
if err != nil {
log.Warn(err)
return ""
}
if val, ok := extensionStatusMap[id]; ok && !val {
err := fmt.Errorf("Extension with ID %s is not enabled", id)
log.Fatal(err)
return err
if val == "" {
log.Warn("Field not found")
return ""
}
extension.init(id)
fmt.Printf("Registered extension: %+v\n", extension)
extensionsMap[id] = &extension
return nil
return val
}
type ExtensionFactory struct {
Id string
Title string
Description string
Builder func() Extension
}

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"log"
"github.com/hiddify/hiddify-core/common"
pb "github.com/hiddify/hiddify-core/hiddifyrpc"
"google.golang.org/grpc"
)
@@ -18,11 +19,12 @@ func (ExtensionHostService) ListExtensions(ctx context.Context, empty *pb.Empty)
Extensions: make([]*pb.Extension, 0),
}
for _, extension := range extensionsMap {
for _, extension := range allExtensionsMap {
extensionList.Extensions = append(extensionList.Extensions, &pb.Extension{
Id: (*extension).getId(),
Title: (*extension).GetTitle(),
Description: (*extension).GetDescription(),
Id: extension.Id,
Title: extension.Title,
Description: extension.Description,
Enable: generalExtensionData.ExtensionStatusMap[extension.Id],
})
}
return extensionList, nil
@@ -30,7 +32,7 @@ func (ExtensionHostService) ListExtensions(ctx context.Context, empty *pb.Empty)
func (e ExtensionHostService) Connect(req *pb.ExtensionRequest, stream grpc.ServerStreamingServer[pb.ExtensionResponse]) error {
// Get the extension from the map using the Extension ID
if extension, ok := extensionsMap[req.GetExtensionId()]; ok {
if extension, ok := enabledExtensionsMap[req.GetExtensionId()]; ok {
log.Printf("Connecting stream for extension %s", req.GetExtensionId())
log.Printf("Extension data: %+v", extension)
@@ -100,7 +102,7 @@ func (e ExtensionHostService) Connect(req *pb.ExtensionRequest, stream grpc.Serv
}
func (e ExtensionHostService) SubmitForm(ctx context.Context, req *pb.ExtensionRequest) (*pb.ExtensionActionResult, error) {
if extension, ok := extensionsMap[req.GetExtensionId()]; ok {
if extension, ok := enabledExtensionsMap[req.GetExtensionId()]; ok {
(*extension).SubmitData(req.GetData())
return &pb.ExtensionActionResult{
@@ -113,7 +115,7 @@ func (e ExtensionHostService) SubmitForm(ctx context.Context, req *pb.ExtensionR
}
func (e ExtensionHostService) Cancel(ctx context.Context, req *pb.ExtensionRequest) (*pb.ExtensionActionResult, error) {
if extension, ok := extensionsMap[req.GetExtensionId()]; ok {
if extension, ok := enabledExtensionsMap[req.GetExtensionId()]; ok {
(*extension).Cancel()
return &pb.ExtensionActionResult{
@@ -126,9 +128,9 @@ func (e ExtensionHostService) Cancel(ctx context.Context, req *pb.ExtensionReque
}
func (e ExtensionHostService) Stop(ctx context.Context, req *pb.ExtensionRequest) (*pb.ExtensionActionResult, error) {
if extension, ok := extensionsMap[req.GetExtensionId()]; ok {
if extension, ok := enabledExtensionsMap[req.GetExtensionId()]; ok {
(*extension).Stop()
(*extension).StoreData()
return &pb.ExtensionActionResult{
ExtensionId: req.ExtensionId,
Code: pb.ResponseCode_OK,
@@ -137,3 +139,24 @@ func (e ExtensionHostService) Stop(ctx context.Context, req *pb.ExtensionRequest
}
return nil, fmt.Errorf("Extension with ID %s not found", req.GetExtensionId())
}
func (e ExtensionHostService) EditExtension(ctx context.Context, req *pb.EditExtensionRequest) (*pb.ExtensionActionResult, error) {
generalExtensionData.ExtensionStatusMap[req.GetExtensionId()] = req.Enable
if !req.Enable {
ext := *enabledExtensionsMap[req.GetExtensionId()]
if ext != nil {
ext.Stop()
ext.StoreData()
}
delete(enabledExtensionsMap, req.GetExtensionId())
} else {
loadExtension(allExtensionsMap[req.GetExtensionId()])
}
common.Storage.SaveExtensionData("default", generalExtensionData)
return &pb.ExtensionActionResult{
ExtensionId: req.ExtensionId,
Code: pb.ResponseCode_OK,
Message: "Success",
}, nil
}

12
extension/html/a.js Normal file
View File

@@ -0,0 +1,12 @@
import * as a from "./rpc/extension_grpc_web_pb.js";
const client = new ExtensionHostServiceClient('http://localhost:8080');
const request = new GetHelloRequest();
export const getHello = (name) => {
request.setName(name)
client.getHello(request, {}, (err, response) => {
console.log(request.getName());
console.log(response.toObject());
});
}
getHello("D")

View File

@@ -8,18 +8,49 @@
<style>
.monospace { font-family: monospace; }
pre {
background-color: black !important; overflow: auto;
color: white!important; }
</style>
</head>
<body>
<div class="container mt-5">
<div id="extension-list-container">
<div id="connection-page" class="card p-4">
<div id="connection-before-connect" class="card-body">
<h2 class="card-title mb-4">Connection Settings</h2>
<div class="mb-3">
<label for="config-content" class="form-label">Config String</label>
<textarea id="config-content" class="form-control" placeholder="Enter config string here..." rows="3"></textarea>
</div>
<div class="mb-3">
<label for="hiddify-settings" class="form-label">Hiddify Settings</label>
<textarea id="hiddify-settings" class="form-control" placeholder="Enter Hiddify settings here..." rows="3"></textarea>
</div>
<div class="d-flex justify-content-between">
<button id="connect-button" class="btn btn-success">Connect</button>
</div>
</div>
<div id="connection-connecting" class="card-body d-none">
<h2 id="connection-status" class="card-title mb-4">Connecting...</h2>
<button id="disconnect-button" class="btn btn-danger">Disconnect</button>
</div>
</div>
<div id="extension-list-container" class="card p-4">
<h1 class="mb-4">
Extension List
</h1>
<div id="extension-list" class="list-group">
</div>
</div>
<div id="extension-page-container" style="display: none;">
<div id="extension-page-container" class="card p-4">
<div id="extension-page"></div>
</div>
@@ -41,7 +72,7 @@
</div>
</div>
</div>
<script src="https://unpkg.com/ansi_up@5.0.0/ansi_up.js"></script>
<script src="https://unpkg.com/google-protobuf@3.20.1/dist/google-protobuf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/protobufjs@7.X.X/dist/protobuf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js" integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
const hiddify = require("./hiddify_grpc_web_pb.js");
const extension = require("./extension_grpc_web_pb.js");
const grpcServerAddress = '/';
const client = new extension.ExtensionHostServicePromiseClient(grpcServerAddress, null, null);
const extensionClient = new extension.ExtensionHostServicePromiseClient(grpcServerAddress, null, null);
const hiddifyClient = new hiddify.CorePromiseClient(grpcServerAddress, null, null);
module.exports = { client ,extension};
module.exports = { extensionClient ,hiddifyClient};

View File

@@ -0,0 +1,109 @@
const { hiddifyClient } = require('./client.js');
const hiddify = require("./hiddify_grpc_web_pb.js");
function openConnectionPage() {
$("#extension-list-container").show();
$("#extension-page-container").hide();
$("#connection-page").show();
connect();
$("#connect-button").click(async () => {
const hsetting_request = new hiddify.ChangeHiddifySettingsRequest();
hsetting_request.setHiddifySettingsJson($("#hiddify-settings").val());
try{
const hres=await hiddifyClient.changeHiddifySettings(hsetting_request, {});
}catch(err){
$("#hiddify-settings").val("")
console.log(err)
}
const parse_request = new hiddify.ParseRequest();
parse_request.setContent($("#config-content").val());
try{
const pres=await hiddifyClient.parse(parse_request, {});
if (pres.getResponseCode() !== hiddify.ResponseCode.OK){
alert(pres.getMessage());
return
}
$("#config-content").val(pres.getContent());
}catch(err){
console.log(err)
alert(JSON.stringify(err))
return
}
const request = new hiddify.StartRequest();
request.setConfigContent($("#config-content").val());
request.setEnableRawConfig(false);
try{
const res=await hiddifyClient.start(request, {});
console.log(res.getCoreState(),res.getMessage())
handleCoreStatus(res.getCoreState());
}catch(err){
console.log(err)
alert(JSON.stringify(err))
return
}
})
$("#disconnect-button").click(async () => {
const request = new hiddify.Empty();
try{
const res=await hiddifyClient.stop(request, {});
console.log(res.getCoreState(),res.getMessage())
handleCoreStatus(res.getCoreState());
}catch(err){
console.log(err)
alert(JSON.stringify(err))
return
}
})
}
function connect(){
const request = new hiddify.Empty();
const stream = hiddifyClient.coreInfoListener(request, {});
stream.on('data', (response) => {
console.log('Receving ',response);
handleCoreStatus(response);
});
stream.on('error', (err) => {
console.error('Error opening extension page:', err);
// openExtensionPage(extensionId);
});
stream.on('end', () => {
console.log('Stream ended');
setTimeout(connect, 1000);
});
}
function handleCoreStatus(status){
if (status == hiddify.CoreState.STOPPED){
$("#connection-before-connect").show();
$("#connection-connecting").hide();
}else{
$("#connection-before-connect").hide();
$("#connection-connecting").show();
if (status == hiddify.CoreState.STARTING){
$("#connection-status").text("Starting");
$("#connection-status").css("color", "yellow");
}else if (status == hiddify.CoreState.STOPPING){
$("#connection-status").text("Stopping");
$("#connection-status").css("color", "red");
}else if (status == hiddify.CoreState.STARTED){
$("#connection-status").text("Connected");
$("#connection-status").css("color", "green");
}
}
}
module.exports = { openConnectionPage };

View File

@@ -1,7 +1,8 @@
const { listExtensions } = require('./extensionList.js');
const { openConnectionPage } = require('./connectionPage.js');
window.onload = () => {
listExtensions();
openConnectionPage();
};

View File

@@ -1,18 +1,16 @@
const { client,extension } = require('./client.js');
const { extensionClient } = require('./client.js');
const extension = require("./extension_grpc_web_pb.js");
async function listExtensions() {
$("#extension-list-container").show();
$("#extension-page-container").hide();
$("#connection-page").show();
try {
const extensionListContainer = document.getElementById('extension-list-container');
const extensionListContainer = document.getElementById('extension-list');
extensionListContainer.innerHTML = ''; // Clear previous entries
const response = await client.listExtensions(new extension.Empty(), {});
const header = document.createElement('h1');
header.classList.add('mb-4');
header.textContent = "Extension List";
extensionListContainer.appendChild(header);
const response = await extensionClient.listExtensions(new extension.Empty(), {});
const extensionList = response.getExtensionsList();
extensionList.forEach(ext => {
const listItem = createExtensionListItem(ext);
@@ -38,14 +36,20 @@ function createExtensionListItem(ext) {
descriptionElement.className = 'mb-0';
descriptionElement.textContent = ext.getDescription();
contentDiv.appendChild(descriptionElement);
contentDiv.style.width="100%";
listItem.appendChild(contentDiv);
const switchDiv = createSwitchElement(ext);
listItem.appendChild(switchDiv);
const {openExtensionPage} = require('./extensionPage.js');
listItem.addEventListener('click', () => openExtensionPage(ext.getId()));
contentDiv.addEventListener('click', () =>{
if (!ext.getEnable() ){
alert("Extension is not enabled")
return
}
openExtensionPage(ext.getId())
});
return listItem;
}
@@ -58,7 +62,10 @@ function createSwitchElement(ext) {
switchButton.type = 'checkbox';
switchButton.className = 'form-check-input';
switchButton.checked = ext.getEnable();
switchButton.addEventListener('change', () => toggleExtension(ext.getId(), switchButton.checked));
switchButton.addEventListener('change', (e) => {
toggleExtension(ext.getId(), switchButton.checked)
});
switchDiv.appendChild(switchButton);
return switchDiv;
@@ -70,11 +77,12 @@ async function toggleExtension(extensionId, enable) {
request.setEnable(enable);
try {
await client.editExtension(request, {});
await extensionClient.editExtension(request, {});
console.log(`Extension ${extensionId} updated to ${enable ? 'enabled' : 'disabled'}`);
} catch (err) {
console.error('Error updating extension status:', err);
}
listExtensions();
}

View File

@@ -1,18 +1,25 @@
const { client,extension } = require('./client.js');
const { extensionClient } = require('./client.js');
const extension = require("./extension_grpc_web_pb.js");
const { renderForm } = require('./formRenderer.js');
const { listExtensions } = require('./extensionList.js');
var currentExtensionId=undefined;
function openExtensionPage(extensionId) {
currentExtensionId=extensionId;
$("#extension-list-container").hide();
$("#extension-page-container").show();
const request = new extension.ExtensionRequest();
request.setExtensionId(extensionId);
$("#extension-page-container").show();
$("#connection-page").hide();
connect()
}
const stream = client.connect(request, {});
function connect() {
const request = new extension.ExtensionRequest();
request.setExtensionId(currentExtensionId);
const stream = extensionClient.connect(request, {});
stream.on('data', (response) => {
console.log('Receving ',response);
if (response.getExtensionId() === currentExtensionId) {
ui=JSON.parse(response.getJsonUi())
if(response.getType()== proto.hiddifyrpc.ExtensionResponseType.SHOW_DIALOG) {
@@ -27,25 +34,29 @@ function openExtensionPage(extensionId) {
stream.on('error', (err) => {
console.error('Error opening extension page:', err);
// openExtensionPage(extensionId);
});
stream.on('end', () => {
console.log('Stream ended');
setTimeout(connect, 1000);
});
}
async function handleSubmitButtonClick(event) {
event.preventDefault();
bootstrap.Modal.getOrCreateInstance("#extension-dialog").hide();
const formData = new FormData(event.target.closest('form'));
const request = new extension.ExtensionRequest();
const datamap=request.getDataMap()
formData.forEach((value, key) => {
request.getDataMap()[key] = value;
datamap.set(key,value);
});
request.setExtensionId(currentExtensionId);
try {
await client.submitForm(request, {});
await extensionClient.submitForm(request, {});
console.log('Form submitted successfully.');
} catch (err) {
console.error('Error submitting form:', err);
@@ -58,7 +69,9 @@ async function handleCancelButtonClick(event) {
request.setExtensionId(currentExtensionId);
try {
await client.cancel(request, {});
bootstrap.Modal.getOrCreateInstance("#extension-dialog").hide();
await extensionClient.cancel(request, {});
console.log('Extension cancelled successfully.');
} catch (err) {
console.error('Error cancelling extension:', err);
@@ -71,7 +84,7 @@ async function handleStopButtonClick(event) {
request.setExtensionId(currentExtensionId);
try {
await client.stop(request, {});
await extensionClient.stop(request, {});
console.log('Extension stopped successfully.');
currentExtensionId = undefined;
listExtensions(); // Return to the extension list

View File

@@ -1,5 +1,9 @@
const { client } = require('./client.js');
const extension = require("./extension_grpc_web_pb.js");
const ansi_up = new AnsiUp({
escape_html: false,
});
function renderForm(json, dialog, submitAction, cancelAction, stopAction) {
const container = document.getElementById(`extension-page-container${dialog}`);
@@ -10,23 +14,36 @@ function renderForm(json, dialog, submitAction, cancelAction, stopAction) {
existingForm.remove();
}
const form = document.createElement('form');
container.appendChild(form);
form.id = formId;
if (dialog === "dialog") {
document.getElementById("modalLabel").textContent = json.title;
} else {
const titleElement = createTitleElement(json);
if (stopAction != undefined) {
const stopButton = document.createElement('button');
stopButton.textContent = "Back";
stopButton.classList.add('btn', 'btn-danger');
stopButton.addEventListener('click', stopAction);
form.appendChild(stopButton);
}
form.appendChild(titleElement);
}
addElementsToForm(form, json);
const buttonGroup = createButtonGroup(json, submitAction, cancelAction, stopAction);
const buttonGroup = createButtonGroup(json, submitAction, cancelAction);
if (dialog === "dialog") {
document.getElementById("modal-footer").innerHTML = '';
document.getElementById("modal-footer").appendChild(buttonGroup);
const dialog = bootstrap.Modal.getOrCreateInstance("#extension-dialog");
dialog.show()
dialog.on("hidden.bs.modal", () => {
cancelAction()
})
} else {
form.appendChild(buttonGroup);
}
container.appendChild(form);
}
function addElementsToForm(form, json) {
@@ -36,12 +53,12 @@ function addElementsToForm(form, json) {
const description = document.createElement('p');
description.textContent = json.description;
form.appendChild(description);
json.fields.forEach(field => {
const formGroup = createFormGroup(field);
form.appendChild(formGroup);
});
if (json.fields) {
json.fields.forEach(field => {
const formGroup = createFormGroup(field);
form.appendChild(formGroup);
});
}
return form;
}
@@ -72,6 +89,11 @@ function createInputElement(field) {
let input;
switch (field.type) {
case "Console":
input = document.createElement('pre');
input.innerHTML = ansi_up.ansi_to_html(field.value || field.placeholder || '');
input.style.maxHeight = field.lines * 20 + 'px';
break;
case "TextArea":
input = document.createElement('textarea');
input.rows = field.lines || 3;
@@ -167,30 +189,25 @@ function createSwitchElement(field) {
return switchWrapper;
}
function createButtonGroup(json, submitAction, cancelAction, stopAction) {
function createButtonGroup(json, submitAction, cancelAction) {
const buttonGroup = document.createElement('div');
buttonGroup.classList.add('btn-group');
json.buttons.forEach(buttonText => {
const btn = document.createElement('button');
btn.classList.add('btn',"btn-default");
buttonGroup.appendChild(btn);
btn.textContent = buttonText
if (buttonText=="Cancel") {
btn.classList.add( 'btn-secondary');
btn.addEventListener('click', cancelAction);
}else{
if (buttonText=="Submit"||buttonText=="Ok")
btn.classList.add('btn-primary');
btn.addEventListener('click', submitAction);
}
})
const cancelButton = document.createElement('button');
cancelButton.textContent = "Cancel";
cancelButton.classList.add('btn', 'btn-secondary');
cancelButton.addEventListener('click', cancelAction);
buttonGroup.appendChild(cancelButton);
if (stopAction != undefined) {
const stopButton = document.createElement('button');
stopButton.textContent = "Stop";
stopButton.classList.add('btn', 'btn-danger');
stopButton.addEventListener('click', stopAction);
buttonGroup.appendChild(stopButton);
}
if (json.buttonMode === "SubmitCancel") {
const submitButton = document.createElement('button');
submitButton.textContent = "Submit";
submitButton.classList.add('btn', 'btn-primary');
submitButton.addEventListener('click', submitAction);
buttonGroup.appendChild(submitButton);
}
return buttonGroup;

View File

@@ -250,6 +250,230 @@ proto.hiddifyrpc.CorePromiseClient.prototype.start =
};
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.hiddifyrpc.Empty,
* !proto.hiddifyrpc.CoreInfoResponse>}
*/
const methodDescriptor_Core_CoreInfoListener = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/CoreInfoListener',
grpc.web.MethodType.SERVER_STREAMING,
base_pb.Empty,
proto.hiddifyrpc.CoreInfoResponse,
/**
* @param {!proto.hiddifyrpc.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.hiddifyrpc.CoreInfoResponse.deserializeBinary
);
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.CoreInfoResponse>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CoreClient.prototype.coreInfoListener =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/CoreInfoListener',
request,
metadata || {},
methodDescriptor_Core_CoreInfoListener);
};
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.CoreInfoResponse>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CorePromiseClient.prototype.coreInfoListener =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/CoreInfoListener',
request,
metadata || {},
methodDescriptor_Core_CoreInfoListener);
};
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.hiddifyrpc.Empty,
* !proto.hiddifyrpc.OutboundGroupList>}
*/
const methodDescriptor_Core_OutboundsInfo = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/OutboundsInfo',
grpc.web.MethodType.SERVER_STREAMING,
base_pb.Empty,
proto.hiddifyrpc.OutboundGroupList,
/**
* @param {!proto.hiddifyrpc.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.hiddifyrpc.OutboundGroupList.deserializeBinary
);
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.OutboundGroupList>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CoreClient.prototype.outboundsInfo =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/OutboundsInfo',
request,
metadata || {},
methodDescriptor_Core_OutboundsInfo);
};
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.OutboundGroupList>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CorePromiseClient.prototype.outboundsInfo =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/OutboundsInfo',
request,
metadata || {},
methodDescriptor_Core_OutboundsInfo);
};
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.hiddifyrpc.Empty,
* !proto.hiddifyrpc.OutboundGroupList>}
*/
const methodDescriptor_Core_MainOutboundsInfo = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/MainOutboundsInfo',
grpc.web.MethodType.SERVER_STREAMING,
base_pb.Empty,
proto.hiddifyrpc.OutboundGroupList,
/**
* @param {!proto.hiddifyrpc.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.hiddifyrpc.OutboundGroupList.deserializeBinary
);
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.OutboundGroupList>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CoreClient.prototype.mainOutboundsInfo =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/MainOutboundsInfo',
request,
metadata || {},
methodDescriptor_Core_MainOutboundsInfo);
};
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.OutboundGroupList>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CorePromiseClient.prototype.mainOutboundsInfo =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/MainOutboundsInfo',
request,
metadata || {},
methodDescriptor_Core_MainOutboundsInfo);
};
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.hiddifyrpc.Empty,
* !proto.hiddifyrpc.SystemInfo>}
*/
const methodDescriptor_Core_GetSystemInfo = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/GetSystemInfo',
grpc.web.MethodType.SERVER_STREAMING,
base_pb.Empty,
proto.hiddifyrpc.SystemInfo,
/**
* @param {!proto.hiddifyrpc.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.hiddifyrpc.SystemInfo.deserializeBinary
);
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.SystemInfo>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CoreClient.prototype.getSystemInfo =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/GetSystemInfo',
request,
metadata || {},
methodDescriptor_Core_GetSystemInfo);
};
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.SystemInfo>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CorePromiseClient.prototype.getSystemInfo =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/GetSystemInfo',
request,
metadata || {},
methodDescriptor_Core_GetSystemInfo);
};
/**
* @const
* @type {!grpc.web.MethodDescriptor<
@@ -375,16 +599,16 @@ proto.hiddifyrpc.CorePromiseClient.prototype.parse =
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.hiddifyrpc.ChangeConfigOptionsRequest,
* !proto.hiddifyrpc.ChangeHiddifySettingsRequest,
* !proto.hiddifyrpc.CoreInfoResponse>}
*/
const methodDescriptor_Core_ChangeConfigOptions = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/ChangeConfigOptions',
const methodDescriptor_Core_ChangeHiddifySettings = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/ChangeHiddifySettings',
grpc.web.MethodType.UNARY,
proto.hiddifyrpc.ChangeConfigOptionsRequest,
proto.hiddifyrpc.ChangeHiddifySettingsRequest,
proto.hiddifyrpc.CoreInfoResponse,
/**
* @param {!proto.hiddifyrpc.ChangeConfigOptionsRequest} request
* @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} request
* @return {!Uint8Array}
*/
function(request) {
@@ -395,7 +619,7 @@ const methodDescriptor_Core_ChangeConfigOptions = new grpc.web.MethodDescriptor(
/**
* @param {!proto.hiddifyrpc.ChangeConfigOptionsRequest} request The
* @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
@@ -404,32 +628,32 @@ const methodDescriptor_Core_ChangeConfigOptions = new grpc.web.MethodDescriptor(
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.CoreInfoResponse>|undefined}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CoreClient.prototype.changeConfigOptions =
proto.hiddifyrpc.CoreClient.prototype.changeHiddifySettings =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/hiddifyrpc.Core/ChangeConfigOptions',
'/hiddifyrpc.Core/ChangeHiddifySettings',
request,
metadata || {},
methodDescriptor_Core_ChangeConfigOptions,
methodDescriptor_Core_ChangeHiddifySettings,
callback);
};
/**
* @param {!proto.hiddifyrpc.ChangeConfigOptionsRequest} request The
* @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} request The
* request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!Promise<!proto.hiddifyrpc.CoreInfoResponse>}
* Promise that resolves to the response
*/
proto.hiddifyrpc.CorePromiseClient.prototype.changeConfigOptions =
proto.hiddifyrpc.CorePromiseClient.prototype.changeHiddifySettings =
function(request, metadata) {
return this.client_.unaryCall(this.hostname_ +
'/hiddifyrpc.Core/ChangeConfigOptions',
'/hiddifyrpc.Core/ChangeHiddifySettings',
request,
metadata || {},
methodDescriptor_Core_ChangeConfigOptions);
methodDescriptor_Core_ChangeHiddifySettings);
};
@@ -921,6 +1145,62 @@ proto.hiddifyrpc.CorePromiseClient.prototype.setSystemProxyEnabled =
};
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.hiddifyrpc.Empty,
* !proto.hiddifyrpc.LogMessage>}
*/
const methodDescriptor_Core_LogListener = new grpc.web.MethodDescriptor(
'/hiddifyrpc.Core/LogListener',
grpc.web.MethodType.SERVER_STREAMING,
base_pb.Empty,
proto.hiddifyrpc.LogMessage,
/**
* @param {!proto.hiddifyrpc.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.hiddifyrpc.LogMessage.deserializeBinary
);
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.LogMessage>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CoreClient.prototype.logListener =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/LogListener',
request,
metadata || {},
methodDescriptor_Core_LogListener);
};
/**
* @param {!proto.hiddifyrpc.Empty} request The request proto
* @param {?Object<string, string>=} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.hiddifyrpc.LogMessage>}
* The XHR Node Readable Stream
*/
proto.hiddifyrpc.CorePromiseClient.prototype.logListener =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/hiddifyrpc.Core/LogListener',
request,
metadata || {},
methodDescriptor_Core_LogListener);
};
/**
* @param {string} hostname
* @param {?Object} credentials

View File

@@ -23,7 +23,7 @@ var global =
var base_pb = require('./base_pb.js');
goog.object.extend(proto, base_pb);
goog.exportSymbol('proto.hiddifyrpc.ChangeConfigOptionsRequest', null, global);
goog.exportSymbol('proto.hiddifyrpc.ChangeHiddifySettingsRequest', null, global);
goog.exportSymbol('proto.hiddifyrpc.CoreInfoResponse', null, global);
goog.exportSymbol('proto.hiddifyrpc.CoreState', null, global);
goog.exportSymbol('proto.hiddifyrpc.GenerateConfigRequest', null, global);
@@ -356,16 +356,16 @@ if (goog.DEBUG && !COMPILED) {
* @extends {jspb.Message}
* @constructor
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest = function(opt_data) {
proto.hiddifyrpc.ChangeHiddifySettingsRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.hiddifyrpc.ChangeConfigOptionsRequest, jspb.Message);
goog.inherits(proto.hiddifyrpc.ChangeHiddifySettingsRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.displayName = 'proto.hiddifyrpc.ChangeConfigOptionsRequest';
proto.hiddifyrpc.ChangeHiddifySettingsRequest.displayName = 'proto.hiddifyrpc.ChangeHiddifySettingsRequest';
}
/**
* Generated by JsPbCodeGenerator.
@@ -3625,8 +3625,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) {
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.prototype.toObject = function(opt_includeInstance) {
return proto.hiddifyrpc.ChangeConfigOptionsRequest.toObject(opt_includeInstance, this);
proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.toObject = function(opt_includeInstance) {
return proto.hiddifyrpc.ChangeHiddifySettingsRequest.toObject(opt_includeInstance, this);
};
@@ -3635,13 +3635,13 @@ proto.hiddifyrpc.ChangeConfigOptionsRequest.prototype.toObject = function(opt_in
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.hiddifyrpc.ChangeConfigOptionsRequest} msg The msg instance to transform.
* @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.toObject = function(includeInstance, msg) {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.toObject = function(includeInstance, msg) {
var f, obj = {
configOptionsJson: jspb.Message.getFieldWithDefault(msg, 1, "")
hiddifySettingsJson: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
@@ -3655,23 +3655,23 @@ configOptionsJson: jspb.Message.getFieldWithDefault(msg, 1, "")
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.hiddifyrpc.ChangeConfigOptionsRequest}
* @return {!proto.hiddifyrpc.ChangeHiddifySettingsRequest}
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.deserializeBinary = function(bytes) {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.hiddifyrpc.ChangeConfigOptionsRequest;
return proto.hiddifyrpc.ChangeConfigOptionsRequest.deserializeBinaryFromReader(msg, reader);
var msg = new proto.hiddifyrpc.ChangeHiddifySettingsRequest;
return proto.hiddifyrpc.ChangeHiddifySettingsRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.hiddifyrpc.ChangeConfigOptionsRequest} msg The message object to deserialize into.
* @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.hiddifyrpc.ChangeConfigOptionsRequest}
* @return {!proto.hiddifyrpc.ChangeHiddifySettingsRequest}
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.deserializeBinaryFromReader = function(msg, reader) {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
@@ -3680,7 +3680,7 @@ proto.hiddifyrpc.ChangeConfigOptionsRequest.deserializeBinaryFromReader = functi
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setConfigOptionsJson(value);
msg.setHiddifySettingsJson(value);
break;
default:
reader.skipField();
@@ -3695,9 +3695,9 @@ proto.hiddifyrpc.ChangeConfigOptionsRequest.deserializeBinaryFromReader = functi
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.prototype.serializeBinary = function() {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.hiddifyrpc.ChangeConfigOptionsRequest.serializeBinaryToWriter(this, writer);
proto.hiddifyrpc.ChangeHiddifySettingsRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
@@ -3705,13 +3705,13 @@ proto.hiddifyrpc.ChangeConfigOptionsRequest.prototype.serializeBinary = function
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.hiddifyrpc.ChangeConfigOptionsRequest} message
* @param {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.serializeBinaryToWriter = function(message, writer) {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getConfigOptionsJson();
f = message.getHiddifySettingsJson();
if (f.length > 0) {
writer.writeString(
1,
@@ -3722,19 +3722,19 @@ proto.hiddifyrpc.ChangeConfigOptionsRequest.serializeBinaryToWriter = function(m
/**
* optional string config_options_json = 1;
* optional string hiddify_settings_json = 1;
* @return {string}
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.prototype.getConfigOptionsJson = function() {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.getHiddifySettingsJson = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.hiddifyrpc.ChangeConfigOptionsRequest} returns this
* @return {!proto.hiddifyrpc.ChangeHiddifySettingsRequest} returns this
*/
proto.hiddifyrpc.ChangeConfigOptionsRequest.prototype.setConfigOptionsJson = function(value) {
proto.hiddifyrpc.ChangeHiddifySettingsRequest.prototype.setHiddifySettingsJson = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};

45
extension/interface.go Normal file
View File

@@ -0,0 +1,45 @@
package extension
import (
"fmt"
"log"
"github.com/hiddify/hiddify-core/common"
)
var (
allExtensionsMap = make(map[string]ExtensionFactory)
enabledExtensionsMap = make(map[string]*Extension)
generalExtensionData = mustSaveExtensionData{
ExtensionStatusMap: make(map[string]bool),
}
)
type mustSaveExtensionData struct {
ExtensionStatusMap map[string]bool `json:"extensionStatusMap"`
}
func RegisterExtension(factory ExtensionFactory) error {
if _, ok := allExtensionsMap[factory.Id]; ok {
err := fmt.Errorf("Extension with ID %s already exists", factory.Id)
log.Fatal(err)
return err
}
allExtensionsMap[factory.Id] = factory
common.Storage.GetExtensionData("default", &generalExtensionData)
if val, ok := generalExtensionData.ExtensionStatusMap[factory.Id]; ok && val {
loadExtension(factory)
}
return nil
}
func loadExtension(factory ExtensionFactory) error {
extension := factory.Builder()
extension.init(factory.Id)
// fmt.Printf("Registered extension: %+v\n", extension)
enabledExtensionsMap[factory.Id] = &extension
return nil
}

View File

@@ -0,0 +1,47 @@
package sdk
import (
"fmt"
"io/ioutil"
"net/http"
"runtime"
"strings"
"github.com/hiddify/hiddify-core/config"
v2 "github.com/hiddify/hiddify-core/v2"
"github.com/sagernet/sing-box/option"
)
func RunInstance(hiddifySettings *config.HiddifyOptions, singconfig *option.Options) (*v2.HiddifyService, error) {
return v2.RunInstance(hiddifySettings, singconfig)
}
func ParseConfig(hiddifySettings *config.HiddifyOptions, configStr string) (*option.Options, error) {
if hiddifySettings == nil {
hiddifySettings = config.DefaultHiddifyOptions()
}
if strings.HasPrefix(configStr, "http://") || strings.HasPrefix(configStr, "https://") {
client := &http.Client{}
configPath := strings.Split(configStr, "\n")[0]
// Create a new request
req, err := http.NewRequest("GET", configPath, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return nil, err
}
req.Header.Set("User-Agent", "HiddifyNext/2.3.1 ("+runtime.GOOS+") like ClashMeta v2ray sing-box")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making GET request:", err)
return nil, err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read config body: %w", err)
}
configStr = string(body)
}
return config.ParseConfigContentToOptions(configStr, true, hiddifySettings, false)
}

View File

@@ -1,4 +1,4 @@
package ui_elements
package ui
// // Field is an interface that all specific field types implement.
// type Field interface {

View File

@@ -1,4 +1,4 @@
package ui_elements
package ui
// import (
// "encoding/json"

View File

@@ -1,4 +1,4 @@
package ui_elements
package ui
import (
"encoding/json"
@@ -20,27 +20,27 @@ const (
FieldSwitch string = "Switch"
FieldCheckbox string = "Checkbox"
FieldRadioButton string = "RadioButton"
FieldConsole string = "Console"
ValidatorDigitsOnly string = "digitsOnly"
Button_SubmitCancel string = "SubmitCancel"
Button_Cancel string = "Cancel"
Button_Ok string = "Ok"
Button_Submit string = "Submit"
Button_Cancel string = "Cancel"
)
// FormField extends GenericField with additional common properties.
type FormField struct {
Key string `json:"key"`
Type string `json:"type"`
Label string `json:"label,omitempty"`
LabelHidden bool `json:"labelHidden"`
Required bool `json:"required,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Readonly bool `json:"readonly,omitempty"`
Value string `json:"value"`
Validator string `json:"validator,omitempty"`
Items []SelectItem `json:"items,omitempty"`
Lines int `json:"lines,omitempty"`
VerticalScroll bool `json:"verticalScroll,omitempty"`
HorizontalScroll bool `json:"horizontalScroll,omitempty"`
Monospace bool `json:"monospace,omitempty"`
Key string `json:"key"`
Type string `json:"type"`
Label string `json:"label,omitempty"`
LabelHidden bool `json:"labelHidden"`
Required bool `json:"required,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
Readonly bool `json:"readonly,omitempty"`
Value string `json:"value"`
Validator string `json:"validator,omitempty"`
Items []SelectItem `json:"items,omitempty"`
Lines int `json:"lines,omitempty"`
}
// GetType returns the type of the field.
@@ -62,7 +62,7 @@ type Form struct {
Title string `json:"title"`
Description string `json:"description"`
Fields []FormField `json:"fields"`
ButtonMode string `json:"buttonMode"`
Buttons []string `json:"buttons"`
}
func (f *Form) ToJSON() string {

View File

@@ -1,4 +1,4 @@
package ui_elements
package ui
// // ContentField represents a label with additional properties.
// type ContentField struct {

1
extension/ui/data.go Normal file
View File

@@ -0,0 +1 @@
package ui

View File

@@ -1,4 +1,4 @@
package ui_elements
package ui
// import (
// "encoding/json"

15
go.mod
View File

@@ -5,9 +5,12 @@ go 1.22.0
toolchain go1.22.3
require (
github.com/bepass-org/warp-plus v0.0.0-00010101000000-000000000000
github.com/bepass-org/warp-plus v1.2.4
github.com/fatih/color v1.16.0
github.com/improbable-eng/grpc-web v0.15.0
github.com/jellydator/validation v1.1.0
github.com/kardianos/service v1.2.2
github.com/rodaine/table v1.1.1
github.com/sagernet/gomobile v0.1.3
github.com/sagernet/sing v0.4.2
github.com/sagernet/sing-box v1.8.9
@@ -23,7 +26,11 @@ require (
require (
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/rs/cors v1.7.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
nhooyr.io/websocket v1.8.6 // indirect
)
@@ -82,7 +89,7 @@ require (
github.com/quic-go/quic-go v0.46.0 // indirect
github.com/refraction-networking/utls v1.6.7 // indirect
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a
github.com/sagernet/cloudflare-tls v0.0.0-20231208171750-a4483c1b7cd1 // indirect
github.com/sagernet/gvisor v0.0.0-20240428053021-e691de28565f // indirect
github.com/sagernet/netlink v0.0.0-20240523065131-45e60152f9ba // indirect
@@ -115,7 +122,7 @@ require (
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/net v0.28.0
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
@@ -133,4 +140,4 @@ replace github.com/sagernet/wireguard-go => github.com/hiddify/wireguard-go v0.0
replace github.com/bepass-org/warp-plus => github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d
replace github.com/hiddify/ray2sing => github.com/hiddify/ray2sing v0.0.0-20240807031953-a9df25615108
replace github.com/hiddify/ray2sing => github.com/hiddify/ray2sing v0.0.0-20240928154308-dd8fc3f6eedb

35
go.sum
View File

@@ -35,6 +35,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
@@ -90,6 +92,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
@@ -172,8 +176,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -235,8 +239,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
github.com/hiddify/hiddify-sing-box v1.8.9-0.20240908122006-6f1809b87260 h1:FmoDhBLHNfbRRON1b5ie8GpXksTJxcBJmgpg2ALZ398=
github.com/hiddify/hiddify-sing-box v1.8.9-0.20240908122006-6f1809b87260/go.mod h1:6+uKh2mjUECXVS//CnV8FIHOCHm0q/a+ViRDbmeEokI=
github.com/hiddify/ray2sing v0.0.0-20240807031953-a9df25615108 h1:LuDOjwO9GwKAnxhMADCnQcjBTnEBp6JdsoPisf192Q4=
github.com/hiddify/ray2sing v0.0.0-20240807031953-a9df25615108/go.mod h1:Qp3mFdKsJZ5TwBYLREgWp8n2O6dgmNt3aAoX+xpvnsM=
github.com/hiddify/ray2sing v0.0.0-20240928154308-dd8fc3f6eedb h1:jN/Cn96MkECPcQ2Tg0I7W53UV4p1oj3ehEXdpy/Z3pw=
github.com/hiddify/ray2sing v0.0.0-20240928154308-dd8fc3f6eedb/go.mod h1:Qp3mFdKsJZ5TwBYLREgWp8n2O6dgmNt3aAoX+xpvnsM=
github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d h1:vRGKh9ou+/vQGfVYa8MczhbIVjHxlP52OWwrDWO77RA=
github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d/go.mod h1:uSRUbr1CcvFrEV69FTvuJFwpzEmwO8N4knb6+Zq3Ys4=
github.com/hiddify/wireguard-go v0.0.0-20240727191222-383c1da14ff1 h1:xdbHlZtzs+jijAxy85qal835GglwmjohA/srHT8gm9s=
@@ -256,6 +260,8 @@ github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod
github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 h1:9K06NfxkBh25x56yVhWWlKFE8YpicaSfHwoV8SFbueA=
github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2/go.mod h1:3A9PQ1cunSDF/1rbTq99Ts4pVnycWg+vlPkfeD2NLFI=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jellydator/validation v1.1.0 h1:TBkx56y6dd0By2AhtStRdTIhDjtcuoSE9w6G6z7wQ4o=
github.com/jellydator/validation v1.1.0/go.mod h1:AaCjfkQ4Ykdcb+YCwqCtaI3wDsf2UAGhJ06lJs0VgOw=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/josharian/native v1.0.1-0.20221213033349-c1e37c09b531/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
@@ -287,6 +293,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@@ -309,12 +318,17 @@ github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mholt/acmez v1.2.0 h1:1hhLxSgY5FvH5HCnGUuwbKY2VQVo8IU7rxXKSnZ7F30=
github.com/mholt/acmez v1.2.0/go.mod h1:VT9YwH1xgNX1kmYY89gY8xPJC84BFAisjo8Egigt4kE=
@@ -348,8 +362,6 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
@@ -444,8 +456,14 @@ github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rodaine/table v1.1.1 h1:zBliy3b4Oj6JRmncse2Z85WmoQvDrXOYuy0JXCt8Qz8=
github.com/rodaine/table v1.1.1/go.mod h1:iqTRptjn+EVcrVBYtNMlJ2wrJZa3MpULUmcXFpfcziA=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
@@ -727,6 +745,7 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -839,8 +858,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=

View File

@@ -1212,16 +1212,16 @@ func (x *ParseResponse) GetMessage() string {
return ""
}
type ChangeHiddifyOptionsRequest struct {
type ChangeHiddifySettingsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
HiddifyOptionsJson string `protobuf:"bytes,1,opt,name=config_options_json,json=HiddifyOptionsJson,proto3" json:"config_options_json,omitempty"`
HiddifySettingsJson string `protobuf:"bytes,1,opt,name=hiddify_settings_json,json=hiddifySettingsJson,proto3" json:"hiddify_settings_json,omitempty"`
}
func (x *ChangeHiddifyOptionsRequest) Reset() {
*x = ChangeHiddifyOptionsRequest{}
func (x *ChangeHiddifySettingsRequest) Reset() {
*x = ChangeHiddifySettingsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_hiddify_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1229,13 +1229,13 @@ func (x *ChangeHiddifyOptionsRequest) Reset() {
}
}
func (x *ChangeHiddifyOptionsRequest) String() string {
func (x *ChangeHiddifySettingsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChangeHiddifyOptionsRequest) ProtoMessage() {}
func (*ChangeHiddifySettingsRequest) ProtoMessage() {}
func (x *ChangeHiddifyOptionsRequest) ProtoReflect() protoreflect.Message {
func (x *ChangeHiddifySettingsRequest) ProtoReflect() protoreflect.Message {
mi := &file_hiddify_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1247,14 +1247,14 @@ func (x *ChangeHiddifyOptionsRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use ChangeHiddifyOptionsRequest.ProtoReflect.Descriptor instead.
func (*ChangeHiddifyOptionsRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use ChangeHiddifySettingsRequest.ProtoReflect.Descriptor instead.
func (*ChangeHiddifySettingsRequest) Descriptor() ([]byte, []int) {
return file_hiddify_proto_rawDescGZIP(), []int{14}
}
func (x *ChangeHiddifyOptionsRequest) GetHiddifyOptionsJson() string {
func (x *ChangeHiddifySettingsRequest) GetHiddifySettingsJson() string {
if x != nil {
return x.HiddifyOptionsJson
return x.HiddifySettingsJson
}
return ""
}
@@ -1944,203 +1944,201 @@ var file_hiddify_proto_rawDesc = []byte{
0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x18,
0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4c, 0x0a, 0x1a, 0x43, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70,
0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x70, 0x61, 0x74, 0x68,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x50, 0x61, 0x74, 0x68,
0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x3f, 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x57, 0x0a, 0x15, 0x53, 0x65, 0x6c, 0x65, 0x63,
0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x67, 0x12, 0x21, 0x0a,
0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67,
0x22, 0x2d, 0x0a, 0x0e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x74, 0x61, 0x67, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x67, 0x22,
0x7e, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b,
0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a,
0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c,
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
0x3d, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78,
0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x7b,
0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2a, 0x0a, 0x05,
0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65,
0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x53,
0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xbc, 0x01, 0x0a, 0x12, 0x54,
0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x76, 0x36, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x69, 0x70, 0x76, 0x36, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f,
0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74,
0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x74,
0x72, 0x69, 0x63, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x65, 0x6e, 0x64,
0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e,
0x74, 0x5f, 0x6e, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x65, 0x6e, 0x64,
0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74,
0x4e, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x2a, 0x0a, 0x0e, 0x54, 0x75, 0x6e,
0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x41, 0x0a, 0x09, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61,
0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x00, 0x12,
0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a,
0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54,
0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x2a, 0xcd, 0x02, 0x0a, 0x0b, 0x4d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54,
0x59, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x5f, 0x43, 0x4f, 0x4e,
0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14,
0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x53, 0x45,
0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45,
0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54,
0x41, 0x52, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x04, 0x12, 0x14, 0x0a,
0x10, 0x55, 0x4e, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x45, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f,
0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x53,
0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x4c, 0x52, 0x45,
0x41, 0x44, 0x59, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x07, 0x12, 0x16, 0x0a,
0x12, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f,
0x55, 0x4e, 0x44, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43,
0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x09, 0x12,
0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f,
0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x52, 0x52,
0x4f, 0x52, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46,
0x49, 0x47, 0x10, 0x0b, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x50, 0x41,
0x52, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0c, 0x12, 0x18,
0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x5f,
0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0d, 0x2a, 0x42, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c,
0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x00, 0x12,
0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52,
0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10,
0x03, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x2c, 0x0a, 0x07,
0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x45, 0x10,
0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0a,
0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x02, 0x32, 0x93, 0x01, 0x0a, 0x05, 0x48,
0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x3f, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f,
0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65,
0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64,
0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0e, 0x53, 0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c,
0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x48,
0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01,
0x32, 0xe2, 0x09, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x53, 0x74, 0x61,
0x72, 0x74, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e,
0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68,
0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x43, 0x6f,
0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x17,
0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, 0x70,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x52, 0x0a, 0x1c, 0x43, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x6a, 0x73, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0x5e, 0x0a, 0x15,
0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6d,
0x70, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65,
0x6d, 0x70, 0x50, 0x61, 0x74, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18,
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x3f, 0x0a, 0x16,
0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x57, 0x0a,
0x15, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f,
0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x54, 0x61, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f,
0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f,
0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x22, 0x2d, 0x0a, 0x0e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73,
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75,
0x70, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f,
0x75, 0x70, 0x54, 0x61, 0x67, 0x22, 0x7e, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x6b, 0x65,
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65,
0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73,
0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3d, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62,
0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x22, 0x7b, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0e, 0x32, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x4c,
0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x27,
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x68,
0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70,
0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x22, 0xbc, 0x01, 0x0a, 0x12, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x72, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x76, 0x36, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x70, 0x76, 0x36, 0x12, 0x1f, 0x0a, 0x0b, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c,
0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x08, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12,
0x38, 0x0a, 0x18, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65,
0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
0x08, 0x52, 0x16, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x70,
0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61,
0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22,
0x2a, 0x0a, 0x0e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x41, 0x0a, 0x09, 0x43,
0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50,
0x50, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x52, 0x54, 0x49, 0x4e,
0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x02,
0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x2a, 0xcd,
0x02, 0x0a, 0x0b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09,
0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4d, 0x50,
0x54, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e,
0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d,
0x41, 0x4e, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e,
0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x03,
0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43,
0x45, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x4e, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x45,
0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x4c, 0x52,
0x45, 0x41, 0x44, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x06, 0x12, 0x13,
0x0a, 0x0f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45,
0x44, 0x10, 0x07, 0x12, 0x16, 0x0a, 0x12, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f,
0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x49,
0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x50,
0x50, 0x45, 0x44, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43,
0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12,
0x19, 0x0a, 0x15, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x49, 0x4e,
0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0b, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52,
0x52, 0x4f, 0x52, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46,
0x49, 0x47, 0x10, 0x0c, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45,
0x41, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x0d, 0x2a, 0x42,
0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45,
0x42, 0x55, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12,
0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05,
0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, 0x54, 0x41, 0x4c,
0x10, 0x04, 0x2a, 0x2c, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a,
0x04, 0x43, 0x4f, 0x52, 0x45, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49,
0x43, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x02,
0x32, 0x93, 0x01, 0x0a, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x3f, 0x0a, 0x08, 0x53, 0x61,
0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65,
0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0e, 0x53,
0x61, 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e,
0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x32, 0xbe, 0x09, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x65, 0x12,
0x3f, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69,
0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e,
0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x45, 0x0a, 0x10, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74,
0x65, 0x6e, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0d, 0x4f, 0x75, 0x74,
0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x68, 0x69, 0x64,
0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69,
0x73, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x11, 0x4d, 0x61, 0x69, 0x6e, 0x4f, 0x75,
0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0d, 0x4f, 0x75, 0x74, 0x62, 0x6f,
0x75, 0x6e, 0x64, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69,
0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e,
0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x30, 0x01, 0x12, 0x47, 0x0a, 0x11,
0x4d, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c,
0x69, 0x73, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x79,
0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69,
0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x16, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x28, 0x01, 0x30, 0x01, 0x12, 0x37, 0x0a,
0x05, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12,
0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x72,
0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x46, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53,
0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x53, 0x74, 0x6f,
0x70, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x18, 0x2e,
0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f,
0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f,
0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64,
0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x3b, 0x0a, 0x07, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a,
0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x12, 0x25, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x68, 0x69, 0x64,
0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x57, 0x61, 0x72, 0x70, 0x47, 0x65, 0x6e, 0x65,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48,
0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f,
0x78, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x57, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x12, 0x28, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53,
0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x42, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72,
0x12, 0x17, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74,
0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x28, 0x01, 0x30, 0x01, 0x32, 0xfb, 0x01, 0x0a, 0x0d, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74,
0x12, 0x1e, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75,
0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75,
0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04,
0x53, 0x74, 0x6f, 0x70, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x11, 0x2e,
0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75,
0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04,
0x45, 0x78, 0x69, 0x74, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x73, 0x74, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66,
0x6f, 0x30, 0x01, 0x12, 0x37, 0x0a, 0x05, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x18, 0x2e, 0x68,
0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x05,
0x50, 0x61, 0x72, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72,
0x70, 0x63, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x19, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x61, 0x72,
0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x15, 0x43, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6e, 0x67, 0x73, 0x12, 0x28, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x53, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e,
0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x53,
0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72,
0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x11, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c,
0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x72, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x07,
0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x43,
0x6f, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x49, 0x0a, 0x0e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e,
0x64, 0x12, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53,
0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x55, 0x72,
0x6c, 0x54, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72,
0x70, 0x63, 0x2e, 0x55, 0x72, 0x6c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72,
0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x2e,
0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72,
0x61, 0x74, 0x65, 0x57, 0x61, 0x72, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
0x63, 0x2e, 0x57, 0x61, 0x72, 0x70, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53,
0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x12, 0x57, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50,
0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x28, 0x2e, 0x68, 0x69,
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72,
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x4c,
0x6f, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64,
0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e,
0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x4d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x32, 0xfb, 0x01, 0x0a, 0x0d, 0x54, 0x75, 0x6e, 0x6e,
0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x05, 0x53, 0x74, 0x61,
0x72, 0x74, 0x12, 0x1e, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e,
0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e,
0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35,
0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e,
0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35,
0x0a, 0x04, 0x45, 0x78, 0x69, 0x74, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x68, 0x69, 0x64, 0x64,
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69,
0x66, 0x79, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -2176,7 +2174,7 @@ var file_hiddify_proto_goTypes = []any{
(*SystemProxyStatus)(nil), // 15: hiddifyrpc.SystemProxyStatus
(*ParseRequest)(nil), // 16: hiddifyrpc.ParseRequest
(*ParseResponse)(nil), // 17: hiddifyrpc.ParseResponse
(*ChangeHiddifyOptionsRequest)(nil), // 18: hiddifyrpc.ChangeHiddifyOptionsRequest
(*ChangeHiddifySettingsRequest)(nil), // 18: hiddifyrpc.ChangeHiddifySettingsRequest
(*GenerateConfigRequest)(nil), // 19: hiddifyrpc.GenerateConfigRequest
(*GenerateConfigResponse)(nil), // 20: hiddifyrpc.GenerateConfigResponse
(*SelectOutboundRequest)(nil), // 21: hiddifyrpc.SelectOutboundRequest
@@ -2206,13 +2204,13 @@ var file_hiddify_proto_depIdxs = []int32{
30, // 10: hiddifyrpc.Hello.SayHello:input_type -> hiddifyrpc.HelloRequest
30, // 11: hiddifyrpc.Hello.SayHelloStream:input_type -> hiddifyrpc.HelloRequest
5, // 12: hiddifyrpc.Core.Start:input_type -> hiddifyrpc.StartRequest
26, // 13: hiddifyrpc.Core.CoreInfoListener:input_type -> hiddifyrpc.StopRequest
26, // 14: hiddifyrpc.Core.OutboundsInfo:input_type -> hiddifyrpc.StopRequest
26, // 15: hiddifyrpc.Core.MainOutboundsInfo:input_type -> hiddifyrpc.StopRequest
26, // 16: hiddifyrpc.Core.GetSystemInfo:input_type -> hiddifyrpc.StopRequest
31, // 13: hiddifyrpc.Core.CoreInfoListener:input_type -> hiddifyrpc.Empty
31, // 14: hiddifyrpc.Core.OutboundsInfo:input_type -> hiddifyrpc.Empty
31, // 15: hiddifyrpc.Core.MainOutboundsInfo:input_type -> hiddifyrpc.Empty
31, // 16: hiddifyrpc.Core.GetSystemInfo:input_type -> hiddifyrpc.Empty
6, // 17: hiddifyrpc.Core.Setup:input_type -> hiddifyrpc.SetupRequest
16, // 18: hiddifyrpc.Core.Parse:input_type -> hiddifyrpc.ParseRequest
18, // 19: hiddifyrpc.Core.ChangeHiddifyOptions:input_type -> hiddifyrpc.ChangeHiddifyOptionsRequest
18, // 19: hiddifyrpc.Core.ChangeHiddifySettings:input_type -> hiddifyrpc.ChangeHiddifySettingsRequest
5, // 20: hiddifyrpc.Core.StartService:input_type -> hiddifyrpc.StartRequest
31, // 21: hiddifyrpc.Core.Stop:input_type -> hiddifyrpc.Empty
5, // 22: hiddifyrpc.Core.Restart:input_type -> hiddifyrpc.StartRequest
@@ -2221,7 +2219,7 @@ var file_hiddify_proto_depIdxs = []int32{
23, // 25: hiddifyrpc.Core.GenerateWarpConfig:input_type -> hiddifyrpc.GenerateWarpConfigRequest
31, // 26: hiddifyrpc.Core.GetSystemProxyStatus:input_type -> hiddifyrpc.Empty
24, // 27: hiddifyrpc.Core.SetSystemProxyEnabled:input_type -> hiddifyrpc.SetSystemProxyEnabledRequest
26, // 28: hiddifyrpc.Core.LogListener:input_type -> hiddifyrpc.StopRequest
31, // 28: hiddifyrpc.Core.LogListener:input_type -> hiddifyrpc.Empty
27, // 29: hiddifyrpc.TunnelService.Start:input_type -> hiddifyrpc.TunnelStartRequest
31, // 30: hiddifyrpc.TunnelService.Stop:input_type -> hiddifyrpc.Empty
31, // 31: hiddifyrpc.TunnelService.Status:input_type -> hiddifyrpc.Empty
@@ -2235,7 +2233,7 @@ var file_hiddify_proto_depIdxs = []int32{
8, // 39: hiddifyrpc.Core.GetSystemInfo:output_type -> hiddifyrpc.SystemInfo
7, // 40: hiddifyrpc.Core.Setup:output_type -> hiddifyrpc.Response
17, // 41: hiddifyrpc.Core.Parse:output_type -> hiddifyrpc.ParseResponse
4, // 42: hiddifyrpc.Core.ChangeHiddifyOptions:output_type -> hiddifyrpc.CoreInfoResponse
4, // 42: hiddifyrpc.Core.ChangeHiddifySettings:output_type -> hiddifyrpc.CoreInfoResponse
4, // 43: hiddifyrpc.Core.StartService:output_type -> hiddifyrpc.CoreInfoResponse
4, // 44: hiddifyrpc.Core.Stop:output_type -> hiddifyrpc.CoreInfoResponse
4, // 45: hiddifyrpc.Core.Restart:output_type -> hiddifyrpc.CoreInfoResponse
@@ -2432,7 +2430,7 @@ func file_hiddify_proto_init() {
}
}
file_hiddify_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*ChangeHiddifyOptionsRequest); i {
switch v := v.(*ChangeHiddifySettingsRequest); i {
case 0:
return &v.state
case 1:

View File

@@ -123,8 +123,8 @@ message ParseResponse {
string message = 3;
}
message ChangeConfigOptionsRequest {
string config_options_json = 1;
message ChangeHiddifySettingsRequest {
string hiddify_settings_json = 1;
}
message GenerateConfigRequest {
@@ -200,13 +200,13 @@ service Hello {
}
service Core {
rpc Start (StartRequest) returns (CoreInfoResponse);
rpc CoreInfoListener (stream StopRequest) returns (stream CoreInfoResponse);
rpc OutboundsInfo (stream StopRequest) returns (stream OutboundGroupList);
rpc MainOutboundsInfo (stream StopRequest) returns (stream OutboundGroupList);
rpc GetSystemInfo (stream StopRequest) returns (stream SystemInfo);
rpc CoreInfoListener (Empty) returns (stream CoreInfoResponse);
rpc OutboundsInfo (Empty) returns (stream OutboundGroupList);
rpc MainOutboundsInfo (Empty) returns (stream OutboundGroupList);
rpc GetSystemInfo (Empty) returns (stream SystemInfo);
rpc Setup (SetupRequest) returns (Response);
rpc Parse (ParseRequest) returns (ParseResponse);
rpc ChangeConfigOptions (ChangeConfigOptionsRequest) returns (CoreInfoResponse);
rpc ChangeHiddifySettings (ChangeHiddifySettingsRequest) returns (CoreInfoResponse);
//rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse);
rpc StartService (StartRequest) returns (CoreInfoResponse);
rpc Stop (Empty) returns (CoreInfoResponse);
@@ -216,7 +216,7 @@ service Core {
rpc GenerateWarpConfig (GenerateWarpConfigRequest) returns (WarpGenerationResponse);
rpc GetSystemProxyStatus (Empty) returns (SystemProxyStatus);
rpc SetSystemProxyEnabled (SetSystemProxyEnabledRequest) returns (Response);
rpc LogListener (stream StopRequest) returns (stream LogMessage);
rpc LogListener (Empty) returns (stream LogMessage);
}

View File

@@ -161,7 +161,7 @@ const (
Core_GetSystemInfo_FullMethodName = "/hiddifyrpc.Core/GetSystemInfo"
Core_Setup_FullMethodName = "/hiddifyrpc.Core/Setup"
Core_Parse_FullMethodName = "/hiddifyrpc.Core/Parse"
Core_ChangeHiddifyOptions_FullMethodName = "/hiddifyrpc.Core/ChangeHiddifyOptions"
Core_ChangeHiddifySettings_FullMethodName = "/hiddifyrpc.Core/ChangeHiddifySettings"
Core_StartService_FullMethodName = "/hiddifyrpc.Core/StartService"
Core_Stop_FullMethodName = "/hiddifyrpc.Core/Stop"
Core_Restart_FullMethodName = "/hiddifyrpc.Core/Restart"
@@ -178,13 +178,13 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type CoreClient interface {
Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, CoreInfoResponse], error)
OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error)
MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error)
GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, SystemInfo], error)
CoreInfoListener(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CoreInfoResponse], error)
OutboundsInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error)
MainOutboundsInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error)
GetSystemInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SystemInfo], error)
Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*Response, error)
Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)
ChangeHiddifyOptions(ctx context.Context, in *ChangeHiddifyOptionsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
ChangeHiddifySettings(ctx context.Context, in *ChangeHiddifySettingsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
//rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse);
StartService(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error)
@@ -194,7 +194,7 @@ type CoreClient interface {
GenerateWarpConfig(ctx context.Context, in *GenerateWarpConfigRequest, opts ...grpc.CallOption) (*WarpGenerationResponse, error)
GetSystemProxyStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error)
SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*Response, error)
LogListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, LogMessage], error)
LogListener(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LogMessage], error)
}
type coreClient struct {
@@ -215,57 +215,81 @@ func (c *coreClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.C
return out, nil
}
func (c *coreClient) CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, CoreInfoResponse], error) {
func (c *coreClient) CoreInfoListener(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CoreInfoResponse], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[0], Core_CoreInfoListener_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StopRequest, CoreInfoResponse]{ClientStream: stream}
x := &grpc.GenericClientStream[Empty, CoreInfoResponse]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_CoreInfoListenerClient = grpc.BidiStreamingClient[StopRequest, CoreInfoResponse]
type Core_CoreInfoListenerClient = grpc.ServerStreamingClient[CoreInfoResponse]
func (c *coreClient) OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error) {
func (c *coreClient) OutboundsInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[1], Core_OutboundsInfo_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StopRequest, OutboundGroupList]{ClientStream: stream}
x := &grpc.GenericClientStream[Empty, OutboundGroupList]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_OutboundsInfoClient = grpc.BidiStreamingClient[StopRequest, OutboundGroupList]
type Core_OutboundsInfoClient = grpc.ServerStreamingClient[OutboundGroupList]
func (c *coreClient) MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error) {
func (c *coreClient) MainOutboundsInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OutboundGroupList], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[2], Core_MainOutboundsInfo_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StopRequest, OutboundGroupList]{ClientStream: stream}
x := &grpc.GenericClientStream[Empty, OutboundGroupList]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_MainOutboundsInfoClient = grpc.BidiStreamingClient[StopRequest, OutboundGroupList]
type Core_MainOutboundsInfoClient = grpc.ServerStreamingClient[OutboundGroupList]
func (c *coreClient) GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, SystemInfo], error) {
func (c *coreClient) GetSystemInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SystemInfo], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[3], Core_GetSystemInfo_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StopRequest, SystemInfo]{ClientStream: stream}
x := &grpc.GenericClientStream[Empty, SystemInfo]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_GetSystemInfoClient = grpc.BidiStreamingClient[StopRequest, SystemInfo]
type Core_GetSystemInfoClient = grpc.ServerStreamingClient[SystemInfo]
func (c *coreClient) Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*Response, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
@@ -287,10 +311,10 @@ func (c *coreClient) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.C
return out, nil
}
func (c *coreClient) ChangeHiddifyOptions(ctx context.Context, in *ChangeHiddifyOptionsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
func (c *coreClient) ChangeHiddifySettings(ctx context.Context, in *ChangeHiddifySettingsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CoreInfoResponse)
err := c.cc.Invoke(ctx, Core_ChangeHiddifyOptions_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Core_ChangeHiddifySettings_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -377,31 +401,37 @@ func (c *coreClient) SetSystemProxyEnabled(ctx context.Context, in *SetSystemPro
return out, nil
}
func (c *coreClient) LogListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, LogMessage], error) {
func (c *coreClient) LogListener(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[LogMessage], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[4], Core_LogListener_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StopRequest, LogMessage]{ClientStream: stream}
x := &grpc.GenericClientStream[Empty, LogMessage]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_LogListenerClient = grpc.BidiStreamingClient[StopRequest, LogMessage]
type Core_LogListenerClient = grpc.ServerStreamingClient[LogMessage]
// CoreServer is the server API for Core service.
// All implementations must embed UnimplementedCoreServer
// for forward compatibility.
type CoreServer interface {
Start(context.Context, *StartRequest) (*CoreInfoResponse, error)
CoreInfoListener(grpc.BidiStreamingServer[StopRequest, CoreInfoResponse]) error
OutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error
MainOutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error
GetSystemInfo(grpc.BidiStreamingServer[StopRequest, SystemInfo]) error
CoreInfoListener(*Empty, grpc.ServerStreamingServer[CoreInfoResponse]) error
OutboundsInfo(*Empty, grpc.ServerStreamingServer[OutboundGroupList]) error
MainOutboundsInfo(*Empty, grpc.ServerStreamingServer[OutboundGroupList]) error
GetSystemInfo(*Empty, grpc.ServerStreamingServer[SystemInfo]) error
Setup(context.Context, *SetupRequest) (*Response, error)
Parse(context.Context, *ParseRequest) (*ParseResponse, error)
ChangeHiddifyOptions(context.Context, *ChangeHiddifyOptionsRequest) (*CoreInfoResponse, error)
ChangeHiddifySettings(context.Context, *ChangeHiddifySettingsRequest) (*CoreInfoResponse, error)
//rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse);
StartService(context.Context, *StartRequest) (*CoreInfoResponse, error)
Stop(context.Context, *Empty) (*CoreInfoResponse, error)
@@ -411,7 +441,7 @@ type CoreServer interface {
GenerateWarpConfig(context.Context, *GenerateWarpConfigRequest) (*WarpGenerationResponse, error)
GetSystemProxyStatus(context.Context, *Empty) (*SystemProxyStatus, error)
SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*Response, error)
LogListener(grpc.BidiStreamingServer[StopRequest, LogMessage]) error
LogListener(*Empty, grpc.ServerStreamingServer[LogMessage]) error
mustEmbedUnimplementedCoreServer()
}
@@ -425,16 +455,16 @@ type UnimplementedCoreServer struct{}
func (UnimplementedCoreServer) Start(context.Context, *StartRequest) (*CoreInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
}
func (UnimplementedCoreServer) CoreInfoListener(grpc.BidiStreamingServer[StopRequest, CoreInfoResponse]) error {
func (UnimplementedCoreServer) CoreInfoListener(*Empty, grpc.ServerStreamingServer[CoreInfoResponse]) error {
return status.Errorf(codes.Unimplemented, "method CoreInfoListener not implemented")
}
func (UnimplementedCoreServer) OutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error {
func (UnimplementedCoreServer) OutboundsInfo(*Empty, grpc.ServerStreamingServer[OutboundGroupList]) error {
return status.Errorf(codes.Unimplemented, "method OutboundsInfo not implemented")
}
func (UnimplementedCoreServer) MainOutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error {
func (UnimplementedCoreServer) MainOutboundsInfo(*Empty, grpc.ServerStreamingServer[OutboundGroupList]) error {
return status.Errorf(codes.Unimplemented, "method MainOutboundsInfo not implemented")
}
func (UnimplementedCoreServer) GetSystemInfo(grpc.BidiStreamingServer[StopRequest, SystemInfo]) error {
func (UnimplementedCoreServer) GetSystemInfo(*Empty, grpc.ServerStreamingServer[SystemInfo]) error {
return status.Errorf(codes.Unimplemented, "method GetSystemInfo not implemented")
}
func (UnimplementedCoreServer) Setup(context.Context, *SetupRequest) (*Response, error) {
@@ -443,8 +473,8 @@ func (UnimplementedCoreServer) Setup(context.Context, *SetupRequest) (*Response,
func (UnimplementedCoreServer) Parse(context.Context, *ParseRequest) (*ParseResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Parse not implemented")
}
func (UnimplementedCoreServer) ChangeHiddifyOptions(context.Context, *ChangeHiddifyOptionsRequest) (*CoreInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangeHiddifyOptions not implemented")
func (UnimplementedCoreServer) ChangeHiddifySettings(context.Context, *ChangeHiddifySettingsRequest) (*CoreInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ChangeHiddifySettings not implemented")
}
func (UnimplementedCoreServer) StartService(context.Context, *StartRequest) (*CoreInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartService not implemented")
@@ -470,7 +500,7 @@ func (UnimplementedCoreServer) GetSystemProxyStatus(context.Context, *Empty) (*S
func (UnimplementedCoreServer) SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetSystemProxyEnabled not implemented")
}
func (UnimplementedCoreServer) LogListener(grpc.BidiStreamingServer[StopRequest, LogMessage]) error {
func (UnimplementedCoreServer) LogListener(*Empty, grpc.ServerStreamingServer[LogMessage]) error {
return status.Errorf(codes.Unimplemented, "method LogListener not implemented")
}
func (UnimplementedCoreServer) mustEmbedUnimplementedCoreServer() {}
@@ -513,32 +543,48 @@ func _Core_Start_Handler(srv interface{}, ctx context.Context, dec func(interfac
}
func _Core_CoreInfoListener_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CoreServer).CoreInfoListener(&grpc.GenericServerStream[StopRequest, CoreInfoResponse]{ServerStream: stream})
m := new(Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(CoreServer).CoreInfoListener(m, &grpc.GenericServerStream[Empty, CoreInfoResponse]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_CoreInfoListenerServer = grpc.BidiStreamingServer[StopRequest, CoreInfoResponse]
type Core_CoreInfoListenerServer = grpc.ServerStreamingServer[CoreInfoResponse]
func _Core_OutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CoreServer).OutboundsInfo(&grpc.GenericServerStream[StopRequest, OutboundGroupList]{ServerStream: stream})
m := new(Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(CoreServer).OutboundsInfo(m, &grpc.GenericServerStream[Empty, OutboundGroupList]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_OutboundsInfoServer = grpc.BidiStreamingServer[StopRequest, OutboundGroupList]
type Core_OutboundsInfoServer = grpc.ServerStreamingServer[OutboundGroupList]
func _Core_MainOutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CoreServer).MainOutboundsInfo(&grpc.GenericServerStream[StopRequest, OutboundGroupList]{ServerStream: stream})
m := new(Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(CoreServer).MainOutboundsInfo(m, &grpc.GenericServerStream[Empty, OutboundGroupList]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_MainOutboundsInfoServer = grpc.BidiStreamingServer[StopRequest, OutboundGroupList]
type Core_MainOutboundsInfoServer = grpc.ServerStreamingServer[OutboundGroupList]
func _Core_GetSystemInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CoreServer).GetSystemInfo(&grpc.GenericServerStream[StopRequest, SystemInfo]{ServerStream: stream})
m := new(Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(CoreServer).GetSystemInfo(m, &grpc.GenericServerStream[Empty, SystemInfo]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_GetSystemInfoServer = grpc.BidiStreamingServer[StopRequest, SystemInfo]
type Core_GetSystemInfoServer = grpc.ServerStreamingServer[SystemInfo]
func _Core_Setup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetupRequest)
@@ -576,20 +622,20 @@ func _Core_Parse_Handler(srv interface{}, ctx context.Context, dec func(interfac
return interceptor(ctx, in, info, handler)
}
func _Core_ChangeHiddifyOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangeHiddifyOptionsRequest)
func _Core_ChangeHiddifySettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChangeHiddifySettingsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CoreServer).ChangeHiddifyOptions(ctx, in)
return srv.(CoreServer).ChangeHiddifySettings(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Core_ChangeHiddifyOptions_FullMethodName,
FullMethod: Core_ChangeHiddifySettings_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CoreServer).ChangeHiddifyOptions(ctx, req.(*ChangeHiddifyOptionsRequest))
return srv.(CoreServer).ChangeHiddifySettings(ctx, req.(*ChangeHiddifySettingsRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -739,11 +785,15 @@ func _Core_SetSystemProxyEnabled_Handler(srv interface{}, ctx context.Context, d
}
func _Core_LogListener_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CoreServer).LogListener(&grpc.GenericServerStream[StopRequest, LogMessage]{ServerStream: stream})
m := new(Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(CoreServer).LogListener(m, &grpc.GenericServerStream[Empty, LogMessage]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Core_LogListenerServer = grpc.BidiStreamingServer[StopRequest, LogMessage]
type Core_LogListenerServer = grpc.ServerStreamingServer[LogMessage]
// Core_ServiceDesc is the grpc.ServiceDesc for Core service.
// It's only intended for direct use with grpc.RegisterService,
@@ -765,8 +815,8 @@ var Core_ServiceDesc = grpc.ServiceDesc{
Handler: _Core_Parse_Handler,
},
{
MethodName: "ChangeHiddifyOptions",
Handler: _Core_ChangeHiddifyOptions_Handler,
MethodName: "ChangeHiddifySettings",
Handler: _Core_ChangeHiddifySettings_Handler,
},
{
MethodName: "StartService",
@@ -806,31 +856,26 @@ var Core_ServiceDesc = grpc.ServiceDesc{
StreamName: "CoreInfoListener",
Handler: _Core_CoreInfoListener_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "OutboundsInfo",
Handler: _Core_OutboundsInfo_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "MainOutboundsInfo",
Handler: _Core_MainOutboundsInfo_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "GetSystemInfo",
Handler: _Core_GetSystemInfo_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "LogListener",
Handler: _Core_LogListener_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "hiddify.proto",

View File

@@ -6,11 +6,14 @@ import (
pb "github.com/hiddify/hiddify-core/hiddifyrpc"
"github.com/sagernet/sing-box/experimental/libbox"
"google.golang.org/grpc"
)
var systemInfoObserver = NewObserver[pb.SystemInfo](10)
var outboundsInfoObserver = NewObserver[pb.OutboundGroupList](10)
var mainOutboundsInfoObserver = NewObserver[pb.OutboundGroupList](10)
var (
systemInfoObserver = NewObserver[pb.SystemInfo](10)
outboundsInfoObserver = NewObserver[pb.OutboundGroupList](10)
mainOutboundsInfoObserver = NewObserver[pb.OutboundGroupList](10)
)
var (
statusClient *libbox.CommandClient
@@ -18,13 +21,13 @@ var (
groupInfoOnlyClient *libbox.CommandClient
)
func (s *CoreService) GetSystemInfo(stream pb.Core_GetSystemInfoServer) error {
func (s *CoreService) GetSystemInfo(req *pb.Empty, stream grpc.ServerStreamingServer[pb.SystemInfo]) error {
if statusClient == nil {
statusClient = libbox.NewCommandClient(
&CommandClientHandler{},
&libbox.CommandClientOptions{
Command: libbox.CommandStatus,
StatusInterval: 1000000000, //1000ms debounce
StatusInterval: 1000000000, // 1000ms debounce
},
)
@@ -35,18 +38,14 @@ func (s *CoreService) GetSystemInfo(stream pb.Core_GetSystemInfoServer) error {
statusClient.Connect()
}
sub, _, _ := systemInfoObserver.Subscribe()
stopch := make(chan int)
go func() {
stream.Recv()
close(stopch)
}()
sub, done, _ := systemInfoObserver.Subscribe()
for {
select {
case <-stream.Context().Done():
break
case <-stopch:
break
return nil
case <-done:
return nil
case info := <-sub:
stream.Send(&info)
case <-time.After(1000 * time.Millisecond):
@@ -54,13 +53,13 @@ func (s *CoreService) GetSystemInfo(stream pb.Core_GetSystemInfoServer) error {
}
}
func (s *CoreService) OutboundsInfo(stream pb.Core_OutboundsInfoServer) error {
func (s *CoreService) OutboundsInfo(req *pb.Empty, stream grpc.ServerStreamingServer[pb.OutboundGroupList]) error {
if groupClient == nil {
groupClient = libbox.NewCommandClient(
&CommandClientHandler{},
&libbox.CommandClientOptions{
Command: libbox.CommandGroup,
StatusInterval: 500000000, //500ms debounce
StatusInterval: 500000000, // 500ms debounce
},
)
@@ -71,18 +70,14 @@ func (s *CoreService) OutboundsInfo(stream pb.Core_OutboundsInfoServer) error {
groupClient.Connect()
}
sub, _, _ := outboundsInfoObserver.Subscribe()
stopch := make(chan int)
go func() {
stream.Recv()
close(stopch)
}()
sub, done, _ := outboundsInfoObserver.Subscribe()
for {
select {
case <-stream.Context().Done():
break
case <-stopch:
break
return nil
case <-done:
return nil
case info := <-sub:
stream.Send(&info)
case <-time.After(500 * time.Millisecond):
@@ -90,13 +85,13 @@ func (s *CoreService) OutboundsInfo(stream pb.Core_OutboundsInfoServer) error {
}
}
func (s *CoreService) MainOutboundsInfo(stream pb.Core_MainOutboundsInfoServer) error {
func (s *CoreService) MainOutboundsInfo(req *pb.Empty, stream grpc.ServerStreamingServer[pb.OutboundGroupList]) error {
if groupInfoOnlyClient == nil {
groupInfoOnlyClient = libbox.NewCommandClient(
&CommandClientHandler{},
&libbox.CommandClientOptions{
Command: libbox.CommandGroupInfoOnly,
StatusInterval: 500000000, //500ms debounce
StatusInterval: 500000000, // 500ms debounce
},
)
@@ -107,18 +102,14 @@ func (s *CoreService) MainOutboundsInfo(stream pb.Core_MainOutboundsInfoServer)
groupInfoOnlyClient.Connect()
}
sub, _, _ := mainOutboundsInfoObserver.Subscribe()
stopch := make(chan int)
go func() {
stream.Recv()
close(stopch)
}()
sub, stopch, _ := mainOutboundsInfoObserver.Subscribe()
for {
select {
case <-stream.Context().Done():
break
return nil
case <-stopch:
break
return nil
case info := <-sub:
stream.Send(&info)
case <-time.After(500 * time.Millisecond):
@@ -129,9 +120,9 @@ func (s *CoreService) MainOutboundsInfo(stream pb.Core_MainOutboundsInfoServer)
func (s *CoreService) SelectOutbound(ctx context.Context, in *pb.SelectOutboundRequest) (*pb.Response, error) {
return SelectOutbound(in)
}
func SelectOutbound(in *pb.SelectOutboundRequest) (*pb.Response, error) {
err := libbox.NewStandaloneCommandClient().SelectOutbound(in.GroupTag, in.OutboundTag)
if err != nil {
return &pb.Response{
ResponseCode: pb.ResponseCode_FAILED,
@@ -148,9 +139,9 @@ func SelectOutbound(in *pb.SelectOutboundRequest) (*pb.Response, error) {
func (s *CoreService) UrlTest(ctx context.Context, in *pb.UrlTestRequest) (*pb.Response, error) {
return UrlTest(in)
}
func UrlTest(in *pb.UrlTestRequest) (*pb.Response, error) {
err := libbox.NewStandaloneCommandClient().URLTest(in.GroupTag)
if err != nil {
return &pb.Response{
ResponseCode: pb.ResponseCode_FAILED,
@@ -162,5 +153,4 @@ func UrlTest(in *pb.UrlTestRequest) (*pb.Response, error) {
ResponseCode: pb.ResponseCode_OK,
Message: "",
}, nil
}

View File

@@ -3,16 +3,18 @@ package v2
import (
"encoding/json"
"fmt"
"time"
"github.com/hiddify/hiddify-core/bridge"
pb "github.com/hiddify/hiddify-core/hiddifyrpc"
"google.golang.org/grpc"
)
var coreInfoObserver = NewObserver[pb.CoreInfoResponse](10)
var CoreState = pb.CoreState_STOPPED
var (
coreInfoObserver = *NewObserver[*pb.CoreInfoResponse](1)
CoreState = pb.CoreState_STOPPED
)
func SetCoreStatus(state pb.CoreState, msgType pb.MessageType, message string) pb.CoreInfoResponse {
func SetCoreStatus(state pb.CoreState, msgType pb.MessageType, message string) *pb.CoreInfoResponse {
msg := fmt.Sprintf("%s: %s %s", state.String(), msgType.String(), message)
if msgType == pb.MessageType_EMPTY {
msg = fmt.Sprintf("%s: %s", state.String(), message)
@@ -24,32 +26,32 @@ func SetCoreStatus(state pb.CoreState, msgType pb.MessageType, message string) p
MessageType: msgType,
Message: message,
}
coreInfoObserver.Emit(info)
coreInfoObserver.Emit(&info)
if useFlutterBridge {
msg, _ := json.Marshal(StatusMessage{Status: convert2OldState(CoreState)})
bridge.SendStringToPort(statusPropagationPort, string(msg))
}
return info
return &info
}
func (s *CoreService) CoreInfoListener(stream pb.Core_CoreInfoListenerServer) error {
coreSub, _, _ := coreInfoObserver.Subscribe()
func (s *CoreService) CoreInfoListener(req *pb.Empty, stream grpc.ServerStreamingServer[pb.CoreInfoResponse]) error {
coreSub, done, err := coreInfoObserver.Subscribe()
if err != nil {
return err
}
defer coreInfoObserver.UnSubscribe(coreSub)
stopch := make(chan int)
go func() {
stream.Recv()
close(stopch)
}()
for {
select {
case <-stream.Context().Done():
return nil
case <-stopch:
case <-done:
return nil
case info := <-coreSub:
stream.Send(&info)
case <-time.After(500 * time.Millisecond):
stream.Send(info)
// case <-time.After(500 * time.Millisecond):
// info := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_EMPTY, "")
// stream.Send(info)
}
}
}

View File

@@ -83,7 +83,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CORE, err.Error())
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_ERROR_READING_CONFIG, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
return &resp, err
return resp, err
}
content = string(fileContent)
}
@@ -96,7 +96,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CORE, err.Error())
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_ERROR_PARSING_CONFIG, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
return &resp, err
return resp, err
}
if !in.EnableRawConfig {
Log(pb.LogLevel_DEBUG, pb.LogType_CORE, "Building config")
@@ -105,7 +105,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CORE, err.Error())
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_ERROR_BUILDING_CONFIG, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
return &resp, err
return resp, err
}
parsedContent = *parsedContent_tmp
}
@@ -122,7 +122,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CORE, err.Error())
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_START_COMMAND_SERVER, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
return &resp, err
return resp, err
}
}
@@ -132,7 +132,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CORE, err.Error())
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_CREATE_SERVICE, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
return &resp, err
return resp, err
}
Log(pb.LogLevel_DEBUG, pb.LogType_CORE, "Service.. started")
if in.DelayStart {
@@ -144,7 +144,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CORE, err.Error())
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_START_SERVICE, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
return &resp, err
return resp, err
}
Box = instance
if in.EnableOldCommandServer {
@@ -152,7 +152,7 @@ func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error) {
}
resp := SetCoreStatus(pb.CoreState_STARTED, pb.MessageType_EMPTY, "")
return &resp, nil
return resp, nil
}
func (s *CoreService) Parse(ctx context.Context, in *pb.ParseRequest) (*pb.ParseResponse, error) {
@@ -199,13 +199,13 @@ func Parse(in *pb.ParseRequest) (*pb.ParseResponse, error) {
}, err
}
func (s *CoreService) ChangeHiddifyOptions(ctx context.Context, in *pb.ChangeHiddifyOptionsRequest) (*pb.CoreInfoResponse, error) {
return ChangeHiddifyOptions(in)
func (s *CoreService) ChangeHiddifySettings(ctx context.Context, in *pb.ChangeHiddifySettingsRequest) (*pb.CoreInfoResponse, error) {
return ChangeHiddifySettings(in)
}
func ChangeHiddifyOptions(in *pb.ChangeHiddifyOptionsRequest) (*pb.CoreInfoResponse, error) {
HiddifyOptions = &config.HiddifyOptions{}
err := json.Unmarshal([]byte(in.HiddifyOptionsJson), HiddifyOptions)
func ChangeHiddifySettings(in *pb.ChangeHiddifySettingsRequest) (*pb.CoreInfoResponse, error) {
HiddifyOptions = config.DefaultHiddifyOptions()
err := json.Unmarshal([]byte(in.HiddifySettingsJson), HiddifyOptions)
if err != nil {
return nil, err
}
@@ -314,7 +314,7 @@ func Stop() (*pb.CoreInfoResponse, error) {
oldCommandServer = nil
}
resp := SetCoreStatus(pb.CoreState_STOPPED, pb.MessageType_EMPTY, "")
return &resp, nil
return resp, nil
}
func (s *CoreService) Restart(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error) {

View File

@@ -33,6 +33,11 @@ func StartGrpcServer(listenAddressG string, service string) (*grpc.Server, error
}
s := grpc.NewServer()
if service == "core" {
// Setup("./tmp/", "./tmp", "./tmp", 11111, false)
Setup("./tmp", "./", "./tmp", 0, false)
useFlutterBridge = false
pb.RegisterCoreServer(s, &CoreService{})
pb.RegisterExtensionHostServiceServer(s, &extension.ExtensionHostService{})
} else if service == "hello" {

172
v2/independent_instance.go Normal file
View File

@@ -0,0 +1,172 @@
package v2
import (
"fmt"
"io"
"net"
"net/http"
"time"
"github.com/hiddify/hiddify-core/config"
"golang.org/x/net/proxy"
"github.com/sagernet/sing-box/experimental/libbox"
"github.com/sagernet/sing-box/option"
)
func getRandomAvailblePort() uint16 {
// TODO: implement it
listener, err := net.Listen("tcp", ":0")
if err != nil {
panic(err)
}
defer listener.Close()
return uint16(listener.Addr().(*net.TCPAddr).Port)
}
func RunInstanceString(hiddifySettings *config.HiddifyOptions, proxiesInput string) (*HiddifyService, error) {
if hiddifySettings == nil {
hiddifySettings = config.DefaultHiddifyOptions()
}
singconfigs, err := config.ParseConfigContentToOptions(proxiesInput, true, hiddifySettings, false)
if err != nil {
return nil, err
}
return RunInstance(hiddifySettings, singconfigs)
}
func RunInstance(hiddifySettings *config.HiddifyOptions, singconfig *option.Options) (*HiddifyService, error) {
if hiddifySettings == nil {
hiddifySettings = config.DefaultHiddifyOptions()
}
hiddifySettings.EnableClashApi = false
hiddifySettings.InboundOptions.MixedPort = getRandomAvailblePort()
hiddifySettings.InboundOptions.EnableTun = false
hiddifySettings.InboundOptions.EnableTunService = false
hiddifySettings.InboundOptions.SetSystemProxy = false
hiddifySettings.InboundOptions.TProxyPort = 0
hiddifySettings.InboundOptions.LocalDnsPort = 0
hiddifySettings.Region = "other"
hiddifySettings.BlockAds = false
hiddifySettings.LogFile = "/dev/null"
finalConfigs, err := config.BuildConfig(*hiddifySettings, *singconfig)
if err != nil {
return nil, err
}
instance, err := NewService(*finalConfigs)
if err != nil {
return nil, err
}
err = instance.Start()
if err != nil {
return nil, err
}
<-time.After(250 * time.Millisecond)
hservice := &HiddifyService{libbox: instance, ListenPort: hiddifySettings.InboundOptions.MixedPort}
hservice.PingCloudflare()
return hservice, nil
}
type HiddifyService struct {
libbox *libbox.BoxService
ListenPort uint16
}
// dialer, err := s.libbox.GetInstance().Router().Dialer(context.Background())
func (s *HiddifyService) Close() error {
return s.libbox.Close()
}
func (s *HiddifyService) GetContent(url string) (string, error) {
return s.ContentFromURL("GET", url, 10*time.Second)
}
func (s *HiddifyService) ContentFromURL(method string, url string, timeout time.Duration) (string, error) {
if method == "" {
return "", fmt.Errorf("empty method")
}
if url == "" {
return "", fmt.Errorf("empty url")
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
return "", err
}
dialer, err := proxy.SOCKS5("tcp", fmt.Sprintf("127.0.0.1:%d", s.ListenPort), nil, proxy.Direct)
if err != nil {
return "", err
}
transport := &http.Transport{
Dial: dialer.Dial,
}
client := &http.Client{
Transport: transport,
Timeout: timeout,
}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent {
return "", fmt.Errorf("request failed with status code: %d", resp.StatusCode)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
if body == nil {
return "", fmt.Errorf("empty body")
}
return string(body), nil
}
func (s *HiddifyService) PingCloudflare() (time.Duration, error) {
return s.Ping("http://cp.cloudflare.com")
}
// func (s *HiddifyService) RawConnection(ctx context.Context, url string) (net.Conn, error) {
// return
// }
func (s *HiddifyService) PingAverage(url string, count int) (time.Duration, error) {
if count <= 0 {
return -1, fmt.Errorf("count must be greater than 0")
}
var sum int
real_count := 0
for i := 0; i < count; i++ {
delay, err := s.Ping(url)
if err == nil {
real_count++
sum += int(delay.Milliseconds())
} else if real_count == 0 && i > count/2 {
return -1, fmt.Errorf("ping average failed")
}
}
return time.Duration(sum / real_count * int(time.Millisecond)), nil
}
func (s *HiddifyService) Ping(url string) (time.Duration, error) {
startTime := time.Now()
_, err := s.ContentFromURL("HEAD", url, 4*time.Second)
if err != nil {
return -1, err
}
duration := time.Since(startTime)
return duration, nil
}

View File

@@ -6,10 +6,11 @@ import (
pb "github.com/hiddify/hiddify-core/hiddifyrpc"
"github.com/sagernet/sing/common/observable"
"google.golang.org/grpc"
)
func NewObserver[T any](listenerBufferSize int) *observable.Observer[T] {
return observable.NewObserver[T](&observable.Subscriber[T]{}, listenerBufferSize)
return observable.NewObserver(observable.NewSubscriber[T](listenerBufferSize), listenerBufferSize)
}
var logObserver = NewObserver[pb.LogMessage](10)
@@ -17,29 +18,24 @@ var logObserver = NewObserver[pb.LogMessage](10)
func Log(level pb.LogLevel, typ pb.LogType, message string) {
if level != pb.LogLevel_DEBUG {
fmt.Printf("%s %s %s\n", level, typ, message)
}
logObserver.Emit(pb.LogMessage{
Level: level,
Type: typ,
Message: message,
})
}
func (s *CoreService) LogListener(stream pb.Core_LogListenerServer) error {
logSub, _, _ := logObserver.Subscribe()
func (s *CoreService) LogListener(req *pb.Empty, stream grpc.ServerStreamingServer[pb.LogMessage]) error {
logSub, stopch, _ := logObserver.Subscribe()
defer logObserver.UnSubscribe(logSub)
stopch := make(chan int)
go func() {
stream.Recv()
close(stopch)
}()
for {
select {
case <-stream.Context().Done():
return nil
case <-stopch:
return nil
case info := <-logSub:
stream.Send(&info)
case <-time.After(500 * time.Millisecond):

View File

@@ -68,7 +68,7 @@ func readAndBuildConfig(hiddifySettingPath string, configPath string, defaultCon
}
if hiddifySettingPath != "" {
hiddifyconfig, err = readHiddifyOptionsAt(hiddifySettingPath)
hiddifyconfig, err = ReadHiddifyOptionsAt(hiddifySettingPath)
if err != nil {
return result, err
}
@@ -96,7 +96,7 @@ func readConfigContent(configPath string) (ConfigResult, error) {
fmt.Println("Error creating request:", err)
return ConfigResult{}, err
}
req.Header.Set("User-Agent", "HiddifyNext/17.5.0 ("+runtime.GOOS+") like ClashMeta v2ray sing-box")
req.Header.Set("User-Agent", "HiddifyNext/2.3.1 ("+runtime.GOOS+") like ClashMeta v2ray sing-box")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error making GET request:", err)
@@ -222,7 +222,7 @@ func readConfigBytes(content []byte) (*option.Options, error) {
return &options, nil
}
func readHiddifyOptionsAt(path string) (*config.HiddifyOptions, error) {
func ReadHiddifyOptionsAt(path string) (*config.HiddifyOptions, error) {
content, err := os.ReadFile(path)
if err != nil {
return nil, err