How to use cross-domain connections (CORS - Access Control Allow Origin) with SignalR

前端 未结 6 1050
有刺的猬
有刺的猬 2020-12-05 03:08

Using persistent connections and an ASP.NET JavaScript client, I am trying to connect to a sub-domain not the same as the one the page was served from.

ASP.Net Page

6条回答
  •  爱一瞬间的悲伤
    2020-12-05 03:38

    var connection = $.connection('http://somecrossdomainurl/echo')
    connection.start({ transport: 'longPolling', xdomain: true });
    

    https://github.com/SignalR/SignalR/wiki/SignalR-JS-Client

提交回复
热议问题