Skip to content

Commit 8af1f50

Browse files
committed
Adding a configurable default electron port. Our environment does not allow for random port assignment. Port 8000 is not an option for our environment.
1 parent b525bf1 commit 8af1f50

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ElectronNET.Host/main.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ app.on('ready', () => {
6363
if (isSplashScreenEnabled()) {
6464
startSplashScreen();
6565
}
66-
66+
let defaultElectronPort = 8000;
67+
if (manifestJsonFile.electronPort) {
68+
defaultElectronPort = (manifestJsonFile.aspCoreBackendPort)
69+
}
6770
// hostname needs to belocalhost, otherwise Windows Firewall will be triggered.
68-
portscanner.findAPortNotInUse(8000, 65535, 'localhost', function (error, port) {
71+
portscanner.findAPortNotInUse(defaultElectronPort, 65535, 'localhost', function (error, port) {
6972
console.log('Electron Socket IO Port: ' + port);
7073
startSocketApiBridge(port);
7174
});
72-
7375
});
7476

7577
app.on('quit', async (event, exitCode) => {

0 commit comments

Comments
 (0)