mirror of https://github.com/XTLS/Xray-core
pull/5144/head
parent
83c5370eec
commit
8add78c02b
|
@ -64,12 +64,21 @@ type HTTPClientConfig struct {
|
|||
func (v *HTTPClientConfig) Build() (proto.Message, error) {
|
||||
config := new(http.ClientConfig)
|
||||
if v.Address != nil {
|
||||
v.Servers = []*HTTPRemoteConfig{
|
||||
{
|
||||
Address: v.Address,
|
||||
Port: v.Port,
|
||||
Users: []json.RawMessage{{}},
|
||||
},
|
||||
if len(v.Username) == 0 {
|
||||
v.Servers = []*HTTPRemoteConfig{
|
||||
{
|
||||
Address: v.Address,
|
||||
Port: v.Port,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
v.Servers = []*HTTPRemoteConfig{
|
||||
{
|
||||
Address: v.Address,
|
||||
Port: v.Port,
|
||||
Users: []json.RawMessage{{}},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
config.Server = make([]*protocol.ServerEndpoint, len(v.Servers))
|
||||
|
|
|
@ -82,12 +82,21 @@ type SocksClientConfig struct {
|
|||
func (v *SocksClientConfig) Build() (proto.Message, error) {
|
||||
config := new(socks.ClientConfig)
|
||||
if v.Address != nil {
|
||||
v.Servers = []*SocksRemoteConfig{
|
||||
{
|
||||
Address: v.Address,
|
||||
Port: v.Port,
|
||||
Users: []json.RawMessage{{}},
|
||||
},
|
||||
if len(v.Username) == 0 {
|
||||
v.Servers = []*SocksRemoteConfig{
|
||||
{
|
||||
Address: v.Address,
|
||||
Port: v.Port,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
v.Servers = []*SocksRemoteConfig{
|
||||
{
|
||||
Address: v.Address,
|
||||
Port: v.Port,
|
||||
Users: []json.RawMessage{{}},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
config.Server = make([]*protocol.ServerEndpoint, len(v.Servers))
|
||||
|
|
Loading…
Reference in New Issue