Skip to content

Commit 428e53e

Browse files
Merge pull request #266 from gfs/gfs/listen-on-127.0.0.1
Fix ASP.NET backend listening on 0.0.0.0
2 parents dc8987d + 802b1ac commit 428e53e

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

ElectronNET.API/Entities/WebPreferences.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class WebPreferences
1515
public bool DevTools { get; set; } = true;
1616

1717
/// <summary>
18-
/// Whether node integration is enabled. Default is true.
18+
/// Whether node integration is enabled. Required to enable IPC. Default is true.
1919
/// </summary>
2020
[DefaultValue(true)]
2121
public bool NodeIntegration { get; set; } = true;

ElectronNET.API/WebHostBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static IWebHostBuilder UseElectron(this IWebHostBuilder builder, string[]
3131
if(HybridSupport.IsElectronActive)
3232
{
3333
builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
34-
.UseUrls("http://localhost:" + BridgeSettings.WebPort);
34+
.UseUrls("http://127.0.0.1:" + BridgeSettings.WebPort);
3535
}
3636

3737
return builder;

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,16 @@ If you still use this version you will need to invoke it like this:
254254
```
255255
dotnet electronize ...
256256
```
257+
258+
## Node Integration
259+
Electron.NET requires Node Integration to be enabled for IPC to function. If you are not using the IPC functionality you can disable Node Integration like so:
260+
261+
```csharp
262+
WebPreferences wp = new WebPreferences();
263+
wp.NodeIntegration = false;
264+
BrowserWindowOptions browserWindowOptions = new BrowserWindowOptions
265+
{
266+
WebPreferences = wp
267+
}
268+
269+
```

buildReleaseNuGetPackages.cmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
set ENETVER=5.22.12
12
echo "Start building Electron.NET dev stack..."
23
echo "Restore & Build API"
34
cd ElectronNet.API
45
dotnet restore
5-
dotnet build --configuration Release --force /property:Version=5.22.12
6-
dotnet pack /p:Version=5.22.12 --configuration Release --force --output "%~dp0artifacts"
6+
dotnet build --configuration Release --force /property:Version=%ENETVER%
7+
dotnet pack /p:Version=%ENETVER% --configuration Release --force --output "%~dp0artifacts"
78
cd ..
89
echo "Restore & Build CLI"
910
cd ElectronNet.CLI
1011
dotnet restore
11-
dotnet build --configuration Release --force /property:Version=5.22.12
12-
dotnet pack /p:Version=5.22.12 --configuration Release --force --output "%~dp0artifacts"
12+
dotnet build --configuration Release --force /property:Version=%ENETVER%
13+
dotnet pack /p:Version=%ENETVER% --configuration Release --force --output "%~dp0artifacts"
1314
cd ..

0 commit comments

Comments
 (0)