You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 regels
1.2 KiB

  1. using System;
  2. using System.Threading.Tasks;
  3. using Microsoft.AspNet.SignalR;
  4. using Microsoft.Owin;
  5. using Microsoft.Owin.Cors;
  6. using Owin;
  7. [assembly: OwinStartup(typeof(Quanjiang.DigitalSchool.IMServerService.Startup1))]
  8. namespace Quanjiang.DigitalSchool.IMServerService
  9. {
  10. public class Startup1
  11. {
  12. public void Configuration(IAppBuilder app)
  13. {
  14. app.Map("/signalr", map =>
  15. {
  16. map.UseCors(CorsOptions.AllowAll);
  17. var hubConfiguration = new HubConfiguration
  18. {
  19. // You can enable JSONP by uncommenting line below.
  20. // JSONP requests are insecure but some older browsers (and some
  21. // versions of IE) require JSONP to work cross domain
  22. EnableJSONP = true
  23. };
  24. // Run the SignalR pipeline. We're not using MapSignalR
  25. // since this branch is already runs under the "/signalr"
  26. // path.
  27. map.RunSignalR(hubConfiguration);
  28. });
  29. app.MapSignalR();
  30. // 有关如何配置应用程序的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkID=316888
  31. }
  32. }
  33. }