1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-16 18:49:16 -04:00

migrate NetworkList to []Network

This commit is contained in:
Darien Raymond
2018-11-20 16:58:26 +01:00
parent 7b80322b60
commit 769f770cf7
18 changed files with 167 additions and 153 deletions

View File

@@ -47,15 +47,13 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
return s, nil
}
func (s *Server) Network() net.NetworkList {
list := net.NetworkList{
Network: s.config.Network,
}
if len(list.Network) == 0 {
list.Network = append(list.Network, net.Network_TCP)
func (s *Server) Network() []net.Network {
list := s.config.Network
if len(list) == 0 {
list = append(list, net.Network_TCP)
}
if s.config.UdpEnabled {
list.Network = append(list.Network, net.Network_UDP)
list = append(list, net.Network_UDP)
}
return list
}