Skip to content

Fix ASP.NET backend listening on 0.0.0.0 #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ElectronNET.API/Entities/WebPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class WebPreferences
public bool DevTools { get; set; } = true;

/// <summary>
/// Whether node integration is enabled. Default is true.
/// Whether node integration is enabled. Required to enable IPC. Default is true.
/// </summary>
[DefaultValue(true)]
public bool NodeIntegration { get; set; } = true;
Expand Down
2 changes: 1 addition & 1 deletion ElectronNET.API/WebHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static IWebHostBuilder UseElectron(this IWebHostBuilder builder, string[]
if(HybridSupport.IsElectronActive)
{
builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
.UseUrls("http://localhost:" + BridgeSettings.WebPort);
.UseUrls("http://127.0.0.1:" + BridgeSettings.WebPort);
}

return builder;
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,16 @@ If you still use this version you will need to invoke it like this:
```
dotnet electronize ...
```

## Node Integration
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:

```csharp
WebPreferences wp = new WebPreferences();
wp.NodeIntegration = false;
BrowserWindowOptions browserWindowOptions = new BrowserWindowOptions
{
WebPreferences = wp
}

```
9 changes: 5 additions & 4 deletions buildReleaseNuGetPackages.cmd
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
set ENETVER=5.22.12
echo "Start building Electron.NET dev stack..."
echo "Restore & Build API"
cd ElectronNet.API
dotnet restore
dotnet build --configuration Release --force /property:Version=5.22.12
dotnet pack /p:Version=5.22.12 --configuration Release --force --output "%~dp0artifacts"
dotnet build --configuration Release --force /property:Version=%ENETVER%
dotnet pack /p:Version=%ENETVER% --configuration Release --force --output "%~dp0artifacts"
cd ..
echo "Restore & Build CLI"
cd ElectronNet.CLI
dotnet restore
dotnet build --configuration Release --force /property:Version=5.22.12
dotnet pack /p:Version=5.22.12 --configuration Release --force --output "%~dp0artifacts"
dotnet build --configuration Release --force /property:Version=%ENETVER%
dotnet pack /p:Version=%ENETVER% --configuration Release --force --output "%~dp0artifacts"
cd ..