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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user