Configurable Default Electron Port
See original GitHub issueIn many environments developers are not permitted to find available port. We must use specified ports allotted. Can we change the main.js file to include the following (~ line 66):
let defaultElectronPort = 8000;
if (manifestJsonFile.electronPort) {
defaultElectronPort = (manifestJsonFile.aspCoreBackendPort)
}
// hostname needs to belocalhost, otherwise Windows Firewall will be triggered.
portscanner.findAPortNotInUse(defaultElectronPort, 65535, 'localhost', function (error, port) {
console.log('Electron Socket IO Port: ' + port);
startSocketApiBridge(port);
});
This will allow users to explicitly set the port just as you can do with the aspNetCore port.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to change electron-forge default port? - node.js
I just started out using electron-forge and ran into the same issue, and it seemed like the electron/webpack was ignoring my devServer.port ......
Read more >How to change electron forge's renderer port
I just started using electron-forge and I stumbled across a problem : when trying to change the renderer's port (that runs by default...
Read more >[Solved]-How to change electron-forge default port?-Reactjs
I just started out using electron-forge and ran into the same issue, and it seemed like the electron/webpack was ignoring my devServer.port value....
Read more >Common Configuration
Defaults to version of electron , electron-prebuilt or electron-prebuilt-compile dependency. extends Array<String> | String | “undefined” - The name of a built ...
Read more >Debugging the Main Process
The default port is 5858 . electron --inspect=5858 your/app ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I put in the PR. Let me know if it is wrong.
Is there some guidance on the electron.manifest.json “files” section? I think I can work around this problem by making my own main.js but I can’t find any docs on how it works and copying an example ElectronHostHook does seem to overwrite the main.js.