Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Electron UI on different port

Tags:

electron

Is there a way to run an Electron app's UI on a different port? I have an app server (Wildfly) running on port 8080 and when I start the Electron app the app server default page is shown within the Electron app window. I believe that Electron runs on port 8080 in the background. Is there a way to change that to i.e. port 9000?

like image 816
Socrates Avatar asked Oct 26 '25 07:10

Socrates


1 Answers

An Electron app is basically a Chromium browser with NodeJS support which loads any file you want to display from disk. It does not start any server (neither HTTP nor anything else).

With "default app page" I believe you mean the index.html file of the electron-quick-start project. This file, for example, gets loaded in main.js, line 16 using Electron's BrowserWindow#loadFile (...) function. This basically behaves equivalently to loading it using #loadURL ("file:///...") or by using file:// in your browser to load any file from disk.

like image 185
Alexander Leithner Avatar answered Oct 29 '25 07:10

Alexander Leithner