Skip to content

Instantly share code, notes, and snippets.

@davidfowl
Created April 29, 2012 23:21
Show Gist options
  • Save davidfowl/2553923 to your computer and use it in GitHub Desktop.
Save davidfowl/2553923 to your computer and use it in GitHub Desktop.
WebApiSignalR SelfHost
var config = new HttpSelfHostConfiguration("http://localhost:8081");
config.TransferMode = TransferMode.StreamedResponse;
config.Routes.MapConnection<MyConnection>("Echo", "echo/{*operation}");
config.Routes.MapConnection<Raw>("Raw", "raw/{*operation}");
var dispatcher = new PersistentConnectionDispatcher(config);
var server = new HttpSelfHostServer(config, dispatcher);
server.OpenAsync().Wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment