𐲓𐳛𐳪𐳂𐳐 𐲀𐳢𐳦𐳫𐳢 𐲥𐳔𐳛𐳪𐳌𐳑𐳖𐳇 2025-09-13 20:11:24 +08:00 committed by GitHub
parent 83c5370eec
commit 8add78c02b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 12 deletions

View File

@ -64,6 +64,14 @@ type HTTPClientConfig struct {
func (v *HTTPClientConfig) Build() (proto.Message, error) {
config := new(http.ClientConfig)
if v.Address != nil {
if len(v.Username) == 0 {
v.Servers = []*HTTPRemoteConfig{
{
Address: v.Address,
Port: v.Port,
},
}
} else {
v.Servers = []*HTTPRemoteConfig{
{
Address: v.Address,
@ -72,6 +80,7 @@ func (v *HTTPClientConfig) Build() (proto.Message, error) {
},
}
}
}
config.Server = make([]*protocol.ServerEndpoint, len(v.Servers))
for idx, serverConfig := range v.Servers {
server := &protocol.ServerEndpoint{

View File

@ -82,6 +82,14 @@ type SocksClientConfig struct {
func (v *SocksClientConfig) Build() (proto.Message, error) {
config := new(socks.ClientConfig)
if v.Address != nil {
if len(v.Username) == 0 {
v.Servers = []*SocksRemoteConfig{
{
Address: v.Address,
Port: v.Port,
},
}
} else {
v.Servers = []*SocksRemoteConfig{
{
Address: v.Address,
@ -90,6 +98,7 @@ func (v *SocksClientConfig) Build() (proto.Message, error) {
},
}
}
}
config.Server = make([]*protocol.ServerEndpoint, len(v.Servers))
for idx, serverConfig := range v.Servers {
server := &protocol.ServerEndpoint{