mirror of https://github.com/2dust/v2rayN
Utils.GetFreePort() default port to be zero
parent
85b7a728ed
commit
225ca1f2e5
|
@ -466,11 +466,11 @@ public class Utils
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetFreePort(int defaultPort = 9090)
|
public static int GetFreePort(int defaultPort = 0)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Utils.PortInUse(defaultPort))
|
if (!(defaultPort == 0 || Utils.PortInUse(defaultPort)))
|
||||||
{
|
{
|
||||||
return defaultPort;
|
return defaultPort;
|
||||||
}
|
}
|
||||||
|
|
|
@ -790,7 +790,6 @@ public class CoreConfigSingboxService
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
endpoint.address = Utils.String2List(node.RequestHost);
|
endpoint.address = Utils.String2List(node.RequestHost);
|
||||||
// Utils.GetFreePort() 9090 ?
|
|
||||||
endpoint.listen_port = Utils.GetFreePort();
|
endpoint.listen_port = Utils.GetFreePort();
|
||||||
endpoint.type = Global.ProtocolTypes[node.ConfigType];
|
endpoint.type = Global.ProtocolTypes[node.ConfigType];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue