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
|
package newV2board
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
type serverConfig struct {
|
type serverConfig struct {
|
||||||
ServerPort int `json:"server_port"`
|
ServerPort int `json:"server_port"`
|
||||||
BaseConfig struct {
|
BaseConfig struct {
|
||||||
@ -20,11 +24,9 @@ type serverConfig struct {
|
|||||||
// v2ray
|
// v2ray
|
||||||
Network string `json:"network"`
|
Network string `json:"network"`
|
||||||
NetworkSettings struct {
|
NetworkSettings struct {
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Headers struct {
|
Headers *json.RawMessage `json:"headers"`
|
||||||
Host string `json:"Host"`
|
ServiceName string `json:"serviceName"`
|
||||||
} `json:"headers"`
|
|
||||||
ServiceName string `json:"serviceName"`
|
|
||||||
} `json:"networkSettings"`
|
} `json:"networkSettings"`
|
||||||
Tls int `json:"tls"`
|
Tls int `json:"tls"`
|
||||||
|
|
||||||
|
@ -371,22 +371,23 @@ func (c *APIClient) parseV2rayNodeResponse(s *serverConfig) (*api.NodeInfo, erro
|
|||||||
TLSType = "xtls"
|
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 {
|
switch s.Network {
|
||||||
case "ws":
|
case "ws":
|
||||||
path = s.NetworkSettings.Path
|
path = s.NetworkSettings.Path
|
||||||
host = s.NetworkSettings.Headers.Host
|
b, _ := simplejson.NewJson(header)
|
||||||
|
host = b.Get("Host").MustString()
|
||||||
case "grpc":
|
case "grpc":
|
||||||
if s.NetworkSettings.ServiceName != "" {
|
if s.NetworkSettings.ServiceName != "" {
|
||||||
serviceName = 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 {
|
if s.Tls == 1 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user