A tiny, cross-platform, module based web server for .NET
This version backports some fixes that were already in master. See #565 for more details.
Versions 3.5.0 and 3.5.1 were retired because of a problem with NuGet package dependencies. See #569 for details.
Issue #421
Fix issue #452 - Internal server error when response is compressed
PR #450
Version 3.4.0 contains breaking changes. Oops!
This PR is a backport of non-breaking changes since version 3.3.3.
From @rdeago PR #448 :
In preparation for version 4.0, I made some changes to internal classes.
No breaking changes here; this PR could probably be backported to version 3 if desired.
EDIT: I also added back component collections, so they can be safely removed from SWAN 3.0.
EDIT: Added JSON request deserializer with specified property name casing.
Issue #423
The module was rewritten to use pluggable criterions and add the ability to ban by max requests per second.
EmbedIO brings a new security module named IPBanningModule
. This module is an out-of-box feature similar to Fail2ban.
This module integrates one watcher for possible service abuse:
1 - Direct logger inspection - Add Regular Expressions to validate brute-force attacks.
In the next release we will include:
2 - Open connections inspection - Set up max connections per time to validate service abuse attacks.
Check the following example where the module is activated to the webserver with a whitelist of valid clients and a rule to detect massive 404 responses.
var server = new WebServer(o => o
.WithUrlPrefix("http://localhost:1010")
.WithMode(HttpListenerMode.EmbedIO))
.WithIPBanning(o => o
.WithWhitelist(
"",
"172.16.16.124",
"172.16.17.1/24",
"192.168.1-2.2-5")
.WithRules("(404 Not Found)+"), 5,5);
Let's know if you like this new feature or not.
BREAKING CHANGE
Change Two behavior settings to default value true
(Only EmbedIO HttpListener):
EndPointManager.UseIpv6
- By default wildcard will bind to IPAddress.IPv6Any
.HttpListener.IgnoreWriteExceptions
- By default will ignore the exceptions on Response Output Write (this was the default behavior in v2).Issue #400