Exemple #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.UseWebSockets();

            app.Map("/ws-chat", a =>
            {
                var handler = WebSocketHandler.CreateFor <ChatController>(app.ApplicationServices);
                a.Run(handler.HandleRequest);
            });

            app.Map("/ws-my", a =>
            {
                var handler = WebSocketHandler.CreateFor <MyController>(app.ApplicationServices);
                a.Run(handler.HandleRequest);
            });
        }