public static HttpConfiguration MapHubs(this HttpConfiguration config, string url) { var dispatcher = new HubDispatcher(url); config.Routes.MapHubs(url, Global.DependencyResolver); config.MessageHandlers.Add(new SignalRMessageHandler(Global.DependencyResolver, dispatcher, config.Routes)); return config; }
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 handler = new HubDispatcher(Url); app.Context.RemapHandler(handler); } }; }
public IHttpHandler GetHttpHandler(RequestContext requestContext) { var hubLocator = new Lazy<BuildManagerTypeLocator>(() => new BuildManagerTypeLocator()); var typeResolver = new Lazy<BuildManagerTypeResolver>(() => new BuildManagerTypeResolver(hubLocator.Value)); _resolver.Register(typeof(IHubLocator), () => hubLocator.Value); _resolver.Register(typeof(IHubTypeResolver), () => typeResolver.Value); var dispatcher = new HubDispatcher(_url); return new AspNetHandler(_resolver, dispatcher); }
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); } }; }
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); } }; }
public IHttpHandler GetHttpHandler(RequestContext requestContext) { var dispatcher = new HubDispatcher(_url); return new AspNetHandler(_resolver, dispatcher); }