PeakSWC.WebServerTransporter
0.0.6-pre
See the version list below for details.
dotnet add package PeakSWC.WebServerTransporter --version 0.0.6-pre
NuGet\Install-Package PeakSWC.WebServerTransporter -Version 0.0.6-pre
<PackageReference Include="PeakSWC.WebServerTransporter" Version="0.0.6-pre" />
paket add PeakSWC.WebServerTransporter --version 0.0.6-pre
#r "nuget: PeakSWC.WebServerTransporter, 0.0.6-pre"
// Install PeakSWC.WebServerTransporter as a Cake Addin #addin nuget:?package=PeakSWC.WebServerTransporter&version=0.0.6-pre&prerelease // Install PeakSWC.WebServerTransporter as a Cake Tool #tool nuget:?package=PeakSWC.WebServerTransporter&version=0.0.6-pre&prerelease
WebServerTransporter
WebServerTransporter is a nuget package that allows a developer to easily modify a dot net core Kestrel web server that resides on a private IP network (the "PrivateServer") and expose the server on the public network via a proxy called the "Transporter" server.
This functionality is useful when the Private Server cannot be moved to the public cloud because either it interacts with local hardware or depends on legacy systems that would be difficult or expensive to deploy in the cloud.
How it Works
The Private Server connects to the Transporter via a WebSocket connection on port 80. Next, user web requests to the Transporter are routed via the WebSocket to the Private Server. Finally, the Private Server sends the web reponses back to the Transporter which then forwards the responses back to the user's web browser.
Quick Start
Create a razor sample web site
dotnet new razor
Add the reference to the nuget package in the razor.csproj file
<ItemGroup>
<PackageReference Include="PeakSWC.WebServerTransporter" Version="0.0.6-pre" />
</ItemGroup>
Modify the Startup.cs as follows:
using PeakSWC.WebServerTransporter;
Insert "AddWebServerTransporter" to ConfigureServices as follows:
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddWebServerTransporter(new Uri("http://localhost:53343"));
}
Finally, insert "app.UseWebServerTransporter();" into the Configure method as follows:
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseWebServerTransporter();
Download the TransporterServer.exe from https://github.com/budcribar/WebServerTransporter/releases
Start the Transporter server and specify a port as follows
./Transporter.exe http://localhost:53343
Start the razor sample server
dotnet run
Now open a web browser using the URL of the transporter (http://localhost:53343) and try it out. At this point you can host the TransporterServer.exe in the public cloud and have access to your Private Server !
Limitations
Most of the basic functions of the Kestrel web server are supported. However, there a limitations such as Cookie Authentication that is not yet supported
Problems
Please open a bug or feature request here: https://github.com/budcribar/WebServerTransporter/issues/new/choose
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.SignalR (>= 1.1.0)
- Microsoft.AspNetCore.SignalR.Client (>= 3.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.