Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-07-18 02:10:22 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-07-18 02:10:22 +0300
commit1f78842b707a1190b6a84aded269d664254a7f1d (patch)
treef9226bfda4856a6289a657cff21234738be4f8c3 /web/service/server.go
parent81a057d63876df5ba69260ac6b97aeeb7964c87d (diff)
[feature] using xray API for inbound
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/service/server.go')
-rw-r--r--web/service/server.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/web/service/server.go b/web/service/server.go
index 5216be5a..c5f4e264 100644
--- a/web/service/server.go
+++ b/web/service/server.go
@@ -403,25 +403,20 @@ func (s *ServerService) GetLogs(count string, logLevel string) ([]string, error)
}
func (s *ServerService) GetConfigJson() (interface{}, error) {
- // Open the file for reading
- file, err := os.Open(xray.GetConfigPath())
+ config, err := s.xrayService.GetXrayConfig()
if err != nil {
return nil, err
}
- defer file.Close()
-
- // Read the file contents
- fileContents, err := io.ReadAll(file)
+ contents, err := json.MarshalIndent(config, "", " ")
if err != nil {
return nil, err
}
var jsonData interface{}
- err = json.Unmarshal(fileContents, &jsonData)
+ err = json.Unmarshal(contents, &jsonData)
if err != nil {
return nil, err
}
-
return jsonData, nil
}