WebServerLight 0.0.23-beta-23
See the version list below for details.
dotnet add package WebServerLight --version 0.0.23-beta-23
NuGet\Install-Package WebServerLight -Version 0.0.23-beta-23
<PackageReference Include="WebServerLight" Version="0.0.23-beta-23" />
<PackageVersion Include="WebServerLight" Version="0.0.23-beta-23" />
<PackageReference Include="WebServerLight" />
paket add WebServerLight --version 0.0.23-beta-23
#r "nuget: WebServerLight, 0.0.23-beta-23"
#:package WebServerLight@0.0.23-beta-23
#addin nuget:?package=WebServerLight&version=0.0.23-beta-23&prerelease
#tool nuget:?package=WebServerLight&version=0.0.23-beta-23&prerelease
WebServerLight
A C# light weight web server
Setup
In a C# Console program, you have to add this package to your project:
<ItemGroup>
<PackageReference Include="WebServerLight" Version="0.0.23-beta-23" />
</ItemGroup>
Now you can set up your web server with the builder pattern:
var server =
WebServer
.New()
...
.Build();
server.Start();
ReadLine();
server.Stop();
Configuration
The Web Server can be configured with the help of many configuration functions
Enabling HTTP and/or HTTPS
Insecure HTTP can be enabled like this:
var server =
WebServer
.New()
.Http()
.Build();
or specifying another HTTP port:
WebServer
.New()
.Http(8080)
Secure HTTPS can be enabled like this:
var server =
WebServer
.New()
.Https(4433)
.Build();
Certificate for HTTPS
There are two ways for providing a HTTPS Certificate:
- Configuring a .pfx file containig the certificate
- Automatically requesting a certificate via Let's Encrypt
If you have a valid pfx certificate with private key inxcluded, you can configure the web server to use this certificate:
var server =
WebServer
.New()
.Https(4433)
.HttpsCertificate("<path to .pfx file>")
.Build();
To request a certificate via Let's Encrypt you can use the nuget tool https://www.nuget.org/packages/LetsencryptCert .When correctly configured (see README of this tool), it will automatically request a new valid certificate before the old certificate will be invalid. Let's Encrypt will call your website via HTTP to check the domain, so HTTP has to be enabled. All you have to do in your web server besides configuring LetsencryptCert
:
var server =
WebServer
.New()
.Http()
.Https()
.UseLetsEncrypt()
.Build();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CsTools (>= 7.25.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.5 | 11 | 8/19/2025 |
1.0.4 | 59 | 8/3/2025 |
1.0.3 | 149 | 6/19/2025 |
1.0.2 | 147 | 6/18/2025 |
1.0.1 | 288 | 6/12/2025 |
1.0.0 | 282 | 6/10/2025 |
0.0.25-beta-25 | 279 | 6/10/2025 |
0.0.24-beta-24 | 280 | 6/10/2025 |
0.0.23-beta-23 | 258 | 6/9/2025 |
0.0.22-beta-22 | 141 | 6/5/2025 |
0.0.20-beta-21 | 137 | 6/5/2025 |
0.0.20-beta-20 | 134 | 6/4/2025 |
0.0.19-beta-19 | 133 | 6/4/2025 |
0.0.18-beta-18 | 137 | 6/3/2025 |
0.0.17-beta-17 | 134 | 6/2/2025 |
0.0.16-beta-16 | 138 | 6/2/2025 |
0.0.15-beta-15 | 116 | 2/16/2025 |
0.0.14-beta-14 | 106 | 2/16/2025 |
0.0.13-beta-13 | 92 | 2/15/2025 |
0.0.12-beta-12 | 96 | 2/15/2025 |
0.0.11-beta-11 | 86 | 2/15/2025 |
0.0.10-beta-10 | 96 | 2/15/2025 |
0.0.9-beta-9 | 99 | 2/14/2025 |
0.0.8-beta-8 | 122 | 2/12/2025 |
0.0.7-beta-7 | 104 | 2/12/2025 |
0.0.6-beta-6 | 106 | 2/11/2025 |
0.0.5-beta-5 | 97 | 2/10/2025 |
0.0.4-beta-4 | 101 | 2/10/2025 |
0.0.3-beta-3 | 103 | 2/10/2025 |
0.0.2-beta-2 | 100 | 2/10/2025 |
0.0.1-beta-1 | 102 | 2/9/2025 |