예제 #1
0
        public void Init(HttpApplication app)
        {
            app.PostResolveRequestCache += (sender, e) =>
            {
                if (app.Request.AppRelativeCurrentExecutionFilePath.StartsWith(Url, StringComparison.OrdinalIgnoreCase) &&
                    !Path.GetExtension(app.Request.AppRelativeCurrentExecutionFilePath).Equals(".js", StringComparison.OrdinalIgnoreCase))
                {
                    var connection = new HubDispatcher(VirtualPathUtility.ToAbsolute(Url));
                    var host = new AspNetHost(connection);

                    app.Context.RemapHandler(host);
                }
            };
        }
예제 #2
0
        public void Init(HttpApplication app)
        {
            app.PostResolveRequestCache += (sender, e) =>
            {
                if (app.Request.AppRelativeCurrentExecutionFilePath.StartsWith(Url, StringComparison.OrdinalIgnoreCase) &&
                    !Path.GetExtension(app.Request.AppRelativeCurrentExecutionFilePath).Equals(".js", StringComparison.OrdinalIgnoreCase))
                {

                    // Setup asp.net specific dependencies for the hub's dependency resolver
                    AspNetBootstrapper.InitializeHubDependencies();

                    // Get the absolute url
                    string url = VirtualPathUtility.ToAbsolute(Url);

                    // Create the hub dispatcher
                    var connection = new HubDispatcher(url);

                    var host = new AspNetHost(connection);

                    app.Context.RemapHandler(host);
                }
            };
        }