mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-24 15:18:44 +00:00
refactor protos
This commit is contained in:
44 files changed
+331
-313
No files matched your search
@@ -27,7 +27,7 @@ func (this *Account) UnmarshalJSON(data []byte) error {
|
||||
|
||||
func (this *ClientConfig) UnmarshalJSON(data []byte) error {
|
||||
type ServerConfig struct {
|
||||
Address *v2net.AddressPB `json:"address"`
|
||||
Address *v2net.IPOrDomain `json:"address"`
|
||||
Port v2net.Port `json:"port"`
|
||||
Users []json.RawMessage `json:"users"`
|
||||
}
|
||||
@@ -38,9 +38,9 @@ func (this *ClientConfig) UnmarshalJSON(data []byte) error {
|
||||
if err := json.Unmarshal(data, jsonConfig); err != nil {
|
||||
return errors.New("Socks|Client: Failed to parse config: " + err.Error())
|
||||
}
|
||||
this.Server = make([]*protocol.ServerSpecPB, len(jsonConfig.Servers))
|
||||
this.Server = make([]*protocol.ServerEndpoint, len(jsonConfig.Servers))
|
||||
for idx, serverConfig := range jsonConfig.Servers {
|
||||
server := &protocol.ServerSpecPB{
|
||||
server := &protocol.ServerEndpoint{
|
||||
Address: serverConfig.Address,
|
||||
Port: uint32(serverConfig.Port),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user