A tiny, cross-platform, module based web server for .NET
OTHER License
Bot releases are hidden (Show)
Published by geoperez over 5 years ago
UnhandledException
property at IWebServer
:using (var server = new WebServer(webOptions))
{
// Report to console the error only
server.UnhandledException = (ctx, ex, ct) => {
ex.Message.Error(nameof(WebServer));
ctx.Response.StatusCode = 500;
return Task.FromResult(true);
};
// Continue with WebServer start up
}
Published by geoperez over 5 years ago
Some extensions methods, properties, and classes are marked as Obsolete
because they are no longer part of the next major version of EmbedIO. One important breaking change is we are no longer supporting Wildcard routing so we encourage to change your code to Regex routing.
Also, this version includes a subprotocol selector for WebSocket
#285.
Published by geoperez over 5 years ago
Fix issue with SWAN JSON issues updating this dependency.
Published by geoperez over 5 years ago
Breaking changes
This version replaces the logic of how WebApiController
works but introducing new Extension Methods and how the Request and Response are handles in the controller's method.
The core change is that WebApiController
is no longer implementing the interface IHttpContext
. Instead of this, the WebApiController
contains a property HttpContext
where this instance is located. This affect how you can, for example, response a JSON:
[WebApiHandler(HttpVerbs.Post, "/api/data")]
public async Task<bool> PostData()
{
// previous code
return await this.JsonResponseAsync(new { error = "Invalid Product" });
// new code
return await HttpContext.JsonResponseAsync(new { error = "Invalid Product" });
// or using the new virtual methods
return await Ok(new { error = "Invalid Product" });
}
Published by geoperez over 5 years ago
Published by geoperez over 5 years ago
Thanks to @rdeago for the PR #275 (Issue #272).
Published by geoperez over 5 years ago
Remove the WebSocket client and fix several issues.
Published by geoperez over 5 years ago
HTTPS Support
Published by geoperez almost 6 years ago
You can setup IPv6 in two ways:
Using new EndPointManager.UseIpv6 will set IPAddress.IPv6Any for * hostname:
EndPointManager.UseIpv6 = true;
var instance = new WebServer("http://*:8877");
Or directly using the IPv6 address like the lookback:
var instance = new WebServer("http://[::1]:8877");
Task.Delay
from polling (Issue #155)ConfigureAwait(false)
to async invocations.Published by geoperez almost 6 years ago
WebApiController
is renewed. Reduce the methods overhead removing the WebServer and Context arguments. See examples below.RoutingStrategy.Regex
is the default routing scheme.IHttpListener
is runtime/platform independent, you can choose Unosquare HttpListener
implementation with NET47 or NETSTANDARD20. This separation of implementations brings new access to interfaces from common Http objects like IHttpRequest
, IHttpContext
and more.IWebServer
is a new interface to create custom web server implementation, like a Test Web Server where all the operations are in-memory to speed up unit testing. Similar to TestServer from OWIN
HttpListner
is working and code clean-up.Note - We encourage to upgrade to the newest EmbedIO version. Branch version 1.X will no longer be maintained, and issues will be tested against 2.X and resolved just there.
Published by geoperez over 6 years ago
Add new Resources File Module by @nickhodge.
Published by geoperez over 6 years ago
Published by geoperez over 6 years ago
Published by geoperez almost 7 years ago
Workaroud issue Firefox WebSocket #96
Published by geoperez almost 7 years ago
Resolved issue #103 .
Published by geoperez about 7 years ago
Resolved issue #98 and restored .NET Framework 4.7 as target.
Published by geoperez about 7 years ago
Fixed issue with CloseAsync
Published by geoperez about 7 years ago
Fixing issues with performance. Avg 100 req/sec getting index.html @ Sample App.
Published by geoperez about 7 years ago
Published by geoperez about 7 years ago