ahws

所属分类:Websocket编程
开发工具:C#
文件大小:0KB
下载次数:0
上传日期:2018-09-05 15:32:43
上 传 者sh-1993
说明:  异步Http Web服务器
(Asynchronous Http Web Server)

文件列表:
LICENSE (1062, 2018-09-05)
Targets/ (0, 2018-09-05)
Targets/Properties/ (0, 2018-09-05)
Targets/Properties/AssemblyInfo.cs (1413, 2018-09-05)
Targets/ahws-net45.csproj (3287, 2018-09-05)
Targets/ahws-net461.csproj (3291, 2018-09-05)
ahws-example-server/ (0, 2018-09-05)
ahws-example-server/Program.cs (1221, 2018-09-05)
ahws-example-server/ahws-example-server.csproj (308, 2018-09-05)
ahws.sln (1578, 2018-09-05)
ahws/ (0, 2018-09-05)
ahws/Http/ (0, 2018-09-05)
ahws/Http/HttpContext.cs (435, 2018-09-05)
ahws/Http/HttpHeaders.cs (30576, 2018-09-05)
ahws/Http/HttpRequest.cs (3926, 2018-09-05)
ahws/Http/HttpResponse.cs (5668, 2018-09-05)
ahws/Http/HttpSocket.cs (7882, 2018-09-05)
ahws/HttpServer.cs (5121, 2018-09-05)
ahws/Routes.cs (4197, 2018-09-05)
ahws/Websocket/ (0, 2018-09-05)
ahws/Websocket/Extensions/ (0, 2018-09-05)
ahws/Websocket/Extensions/PerMessageDeflate.cs (3187, 2018-09-05)
ahws/Websocket/Extensions/WebsocketExtension.cs (3632, 2018-09-05)
ahws/Websocket/FrameEvent.cs (153, 2018-09-05)
ahws/Websocket/Types.cs (816, 2018-09-05)
ahws/Websocket/WebSocket.cs (19233, 2018-09-05)
ahws/Websocket/WebsocketFrame.cs (3759, 2018-09-05)
ahws/Websocket/WebsocketServer.cs (3645, 2018-09-05)
ahws/ahws.csproj (225, 2018-09-05)

AHWS == Async Http Web Server Simple to use Async webserver with websocket support Example Http Server === ``` HttpServer s = new HttpServer(8080); s.OnLog += Console.WriteLine; s.Options = HttpServerOptions.GZip | HttpServerOptions.KeepAlive; s.AddRoute("/", (h) => { var rsp = h.Request.CreateResponse(HttpStatus.OK); rsp.Content = new HttpContent(Encoding.UTF8.GetBytes("

Hello world!

")); rsp.Headers.ContentType = "text/html"; return rsp; }); s.Start(); ``` Example Websocket Echo === ``` HttpServer s = new HttpServer(8080); WebsocketServer ws = new WebsocketServer(); ws.OnWebsocketConnect += (w) => { w.OnFrame += async (f) => { //send the frame back await f.WebSocket.SendFrame(f.Frame); }; w.Start(); }; s.OnLog += Console.WriteLine; s.Options = HttpServerOptions.GZip | HttpServerOptions.KeepAlive; s.AddRoute("/ws", ws.WebsocketUpgrade); s.Start(); ```

近期下载者

相关文件


收藏者