mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-04-28 17:11:14 +00:00
implement auto port detect for web bridge
This commit is contained in:
@@ -3,5 +3,6 @@
|
||||
public static class BridgeSettings
|
||||
{
|
||||
public static string SocketPort { get; set; }
|
||||
public static string WebPort { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,16 @@ namespace ElectronNET.API
|
||||
{
|
||||
BridgeSettings.SocketPort = argument.ToUpper().Replace("/ELECTRONPORT=", "");
|
||||
Console.WriteLine("Use Electron Port: " + BridgeSettings.SocketPort);
|
||||
} else if(argument.ToUpper().Contains("ELECTRONWEBPORT"))
|
||||
{
|
||||
BridgeSettings.WebPort = argument.ToUpper().Replace("/ELECTRONWEBPORT=", "");
|
||||
}
|
||||
}
|
||||
|
||||
if(IsElectronActive())
|
||||
{
|
||||
builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory);
|
||||
builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
|
||||
.UseUrls("http://0.0.0.0:" + BridgeSettings.WebPort);
|
||||
}
|
||||
|
||||
return builder;
|
||||
|
||||
Reference in New Issue
Block a user