Skip to content

Releases: unosquare/embedio

Global Exception Handler for IWebServer

28 May 16:48
Compare
Choose a tag to compare
  • Global Exception Handler was added as propose issue #300. For example, if you want to remove the default HTML error response, you can add a function to the 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
}
  • The MIME Types Dictionary was reverted to plain Dictionary to allow add new entries (Issue #302)

Mark Obsolete items and WebSocket subprotocol selector

23 May 18:08
05a7250
Compare
Choose a tag to compare

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.

Update dependencies

21 May 14:41
da3ea74
Compare
Choose a tag to compare

Fix issue with SWAN JSON issues updating this dependency.

Update WebApiController

25 Apr 19:39
Compare
Choose a tag to compare

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" });
}

Add Items to IHttpContext

23 Apr 16:01
Compare
Choose a tag to compare
  • Add Items to IHttpContext
  • Add virtual methods to WebApiController
  • Fix #278 (Thanks @rdeago)

Improvements to StaticFileModule

22 Apr 18:13
Compare
Choose a tag to compare

Thanks to @rdeago for the PR #275 (Issue #272).

Smaller EmbedIO

11 Apr 18:15
d735732
Compare
Choose a tag to compare

Remove the WebSocket client and fix several issues.

HTTPS Support

22 Jan 21:13
Compare
Choose a tag to compare

HTTPS Support

IPv6 Support

11 Dec 13:51
66b84c4
Compare
Choose a tag to compare
  • Support to IPv6 (Issue #214)

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");
  • Fix WebSocket client for targets NET47 and NETCOREAPP21
  • Remove Task.Delay from polling (Issue #155)
  • Add ConfigureAwait(false) to async invocations.

New EmbedIO 2.0

15 Nov 20:03
409b761
Compare
Choose a tag to compare

Breaking changes

  • WebApiController is renewed. Reduce the methods overhead removing the WebServer and Context arguments. See examples below.
  • RoutingStrategy.Regex is the default routing scheme.

Additional changes

  • 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
  • General improvements in how the Unosquare 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.