#Access web server in preload from renderer

10 messages · Page 1 of 1 (latest)

fathom rock
#

Hi all, I'm adapting a web app for the desktop. I have my API server using express.js and SQLite running in the preload process. If I make a request from the renderer process, it doesn't make it to the server. Is this expected behaviour? I'm aware of the security model, but I'm not clear on whether ports are open between these two processes.

Also, should I be running my server in preload, or should I spawn it as a node process in main? Can that be done in a secure way?

Thanks for any advice!

white badger
#

doesnt matter how you run it

#

using http server isnt safe

fathom rock
#

It's pretty secure at the moment... Can't access it from the renderer or a normal browser.

white badger
#

Then server doesnt work

fathom rock
#

Hm, useful comment. The server is actually running, based on the output logs.

white badger
#

You didn't provide any useful info

fathom rock
#

Getting back to my question, can anyone let me know if the ports should be accessible in these processes, or if they are blocked by electron for security reasons?

white badger
#

Electron do not block anything

#

On server side at least