Exemple #1
0
        protected override void AcceptWebSocket(TcpClient client)
        {
            var context = Ext.AcceptWebSocket(client, IsSecure);
            var socket  = context.WebSocket;
            var path    = Ext.UrlDecode(context.Path);

            if (path != Ext.UrlDecode(Ext.GetAbsolutePath(Uri)))
            {
                socket.Close(HttpStatusCode.NotImplemented);
                return;
            }

            if (Uri.IsAbsoluteUri)
            {
                socket.Url = Uri;
            }

            BindWebSocket(socket);
        }