mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Electron.NET serves webpages over network #279
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @The-MAZZTer on GitHub (Feb 10, 2019).
From the console window that shows when you run electronize start:
Now listening on: http://0.0.0.0:8001
ASP.NET should be configured to listen on 127.0.0.1, not 0.0.0.0, as the latter allows for external computers to connect, which is not desired for Electron.
@JimmyTheJ commented on GitHub (Feb 11, 2019):
Correct, so don't expose all IPs like that in your dotnet code.
Just add .UseUrls() in program.cs, or add a JSON config to setup your kestrel or whatever other way you want to configure it.
@The-MAZZTer commented on GitHub (Feb 13, 2019):
I think I ended up with 0.0.0.0 just following the README quickstart (I had no .UseUrls)
so I assume that is the ASP.NET default?Perhaps .UseElectron should call .UseUrls for you? (Not like you need to know the url anyway, it's all internal.) Or at least the code sample in README should have a .UseUrls?Edit: If I call .UseUrls before .UseElectron, it has NO EFFECT. I have to call it AFTER .UseElectron. I think .UseElectron is trying to force 0.0.0.0. I think this should be considered a potential security vulnerability since even if the developer indicates 0.0.0.0 should not be used, it is still used.
Edit 2: I was correct, I went looking for the function in the code and found this:
2fb3062d4b