mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-19 13:42:24 +00:00
Utils.GetFreePort() default port to be zero
This commit is contained in:
parent
b938538926
commit
f2c7cb4e43
2 changed files with 2 additions and 3 deletions
|
@ -427,11 +427,11 @@ public class Utils
|
|||
return false;
|
||||
}
|
||||
|
||||
public static int GetFreePort(int defaultPort = 9090)
|
||||
public static int GetFreePort(int defaultPort = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Utils.PortInUse(defaultPort))
|
||||
if (!(defaultPort == 0 || Utils.PortInUse(defaultPort)))
|
||||
{
|
||||
return defaultPort;
|
||||
}
|
||||
|
|
|
@ -825,7 +825,6 @@ public class CoreConfigSingboxService
|
|||
try
|
||||
{
|
||||
endpoints.address = Utils.String2List(node.RequestHost);
|
||||
// Utils.GetFreePort() 9090 ?
|
||||
endpoints.listen_port = Utils.GetFreePort();
|
||||
endpoints.type = Global.ProtocolTypes[node.ConfigType];
|
||||
|
||||
|
|
Loading…
Reference in a new issue