<commit_before>﻿using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using System.Net.WebSockets;
using Microsoft.AspNet.WebSockets.Server;
using Microsoft.AspNet.StaticFiles;
using Microsoft.AspNet.Http;
using System.Collections.Generic;

namespace WebSocketExample
{
    public class Startup
    {
        public void Configure(IApplicationBuilder app)
        {
            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.Map("/ws", builder =>
            {
                builder.Use(async (context, next) =>
                {
                    if (context.WebSockets.IsWebSocketRequest)
                    {
                        var webSocket = await context.WebSockets.AcceptWebSocketAsync();
                        await Echo(webSocket);
                        return;
                    }
                    await next();
                });
            });
        }
<commit_msg>The Kestrel server implementation for some reason does not support websocket. On client the error 1006 is received all the time.<commit_after>﻿using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using System.Net.WebSockets;
using Microsoft.AspNet.WebSockets.Server;
using Microsoft.AspNet.StaticFiles;
using Microsoft.AspNet.Http;
using System.Collections.Generic;

namespace WebSocketExample
{
    public class Startup
    {
        public void Configure(IApplicationBuilder app)
        {
            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.Map("/ws", builder =>
            {
                builder.Use(async (context, next) =>
                {
                    // Comment this out to test native server implementations
                    //builder.UseWebSockets(new WebSocketOptions()
                    //{
                    //    ReplaceFeature = true,
                    //});

                    if (context.WebSockets.IsWebSocketRequest)
                    {
                        var webSocket = await context.WebSockets.AcceptWebSocketAsync();
                        await Echo(webSocket);
                        return;
                    }
                    await next();
                });
            });
        }

{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.001736111111111111, 'mean_word_length': 1.5357535753575358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2266830', 'n_tokens_mistral': 552, 'n_tokens_neox': 532, 'n_words': 122}