mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-08 13:29:54 +00:00
fix: typo
This commit is contained in:
parent
8ddf257aa4
commit
451b5a1fd4
@ -1,5 +1,9 @@
|
||||
package newV2board
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
type serverConfig struct {
|
||||
ServerPort int `json:"server_port"`
|
||||
BaseConfig struct {
|
||||
@ -20,11 +24,9 @@ type serverConfig struct {
|
||||
// v2ray
|
||||
Network string `json:"network"`
|
||||
NetworkSettings struct {
|
||||
Path string `json:"path"`
|
||||
Headers struct {
|
||||
Host string `json:"Host"`
|
||||
} `json:"headers"`
|
||||
ServiceName string `json:"serviceName"`
|
||||
Path string `json:"path"`
|
||||
Headers *json.RawMessage `json:"headers"`
|
||||
ServiceName string `json:"serviceName"`
|
||||
} `json:"networkSettings"`
|
||||
Tls int `json:"tls"`
|
||||
|
||||
|
@ -371,22 +371,23 @@ func (c *APIClient) parseV2rayNodeResponse(s *serverConfig) (*api.NodeInfo, erro
|
||||
TLSType = "xtls"
|
||||
}
|
||||
|
||||
if s.NetworkSettings.Headers != nil {
|
||||
if httpHeader, err := s.NetworkSettings.Headers.MarshalJSON(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
header = httpHeader
|
||||
}
|
||||
}
|
||||
|
||||
switch s.Network {
|
||||
case "ws":
|
||||
path = s.NetworkSettings.Path
|
||||
host = s.NetworkSettings.Headers.Host
|
||||
b, _ := simplejson.NewJson(header)
|
||||
host = b.Get("Host").MustString()
|
||||
case "grpc":
|
||||
if s.NetworkSettings.ServiceName != "" {
|
||||
serviceName = s.NetworkSettings.ServiceName
|
||||
}
|
||||
case "tcp":
|
||||
if &s.NetworkSettings.Headers != nil {
|
||||
if httpHeader, err := json.Marshal(s.NetworkSettings.Headers); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
header = httpHeader
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if s.Tls == 1 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user