Example #1
0
        public async Task StartAsync()
        {
            var config = new WebSocketConfig
            {
                Host           = "ws://server.example.com",
                RequireOrigin  = false,
                UpgradeTimeout = TimeSpan.FromSeconds(10),
                Protocols      = new[] { "proto1", "proto2" },
                MaxFrameCount  = 1
            };
            var server = new WsLiteServer(config, IPAddress.Parse("127.0.0.1"), 80);

            await server.AcceptConnectionsAsync <TestingHandler>(10, Ct.Token);
        }
Example #2
0
 public HandlerContext(WsLiteServer server, WsLiteConnection connection, IServiceProvider services)
 {
     Server     = server;
     Connection = connection;
     Services   = services;
 }