Owin
Owin
应用程序代理
using AppFunc=Func<IDictionary<string,object>,Task>;
IDictionary<string,object>环境变量,贯穿整个处理流程
Microsoft.Owin.Host.SystemWeb
可以接管IIS请求(App>Middleware>Server>Host)Server层
MIcrosoft.Owin.Host.HttpListener(Server层,可以实现控制台寄宿)
Microsoft.Owin.StaticFiles(实现静态站点托管)
Startup
app.User(); //添加处理管道,顺序处理
<add key="owin:HandleAllRequests" value="true"/> //处理所有请求
继承OwinMiddleware实现处理管道
AuthenticationMiddleware : OwinMiddleware
public void Configuration(IAppBuilder app)
{
app.Use<AuthenticationMiddleware>();
app.Use<AuthorizationMiddleware>();
app.Use(async (context, next) =>
{
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello World!");
});
}
url:http://www.cnblogs.com/jesse2013/p/owin-webserver.html