SignalR hubs cross-domain is broken in Chrome and Firefox, long polling works in IE11 -
SignalR hubs cross-domain is broken in Chrome and Firefox, long polling works in IE11 -
i'm using signalr 2.0.3. can't find working, reliable examples version of signalr.
on server, have this:
app.map("/signalr", map => { map.usecors(corsoptions.allowall); var cfg = new hubconfiguration() { enablejsonp = true }; cfg.enabledetailederrors = true; map.runsignalr(cfg); });
on client, have this:
var settings = function() { var connectionurl = window.location.protocol + "//signalr.mydomain.com/signalr"; var querystring = "email=jdentler%40dwhomes.com\u0026windowsaccountname=jdentler"; homecoming { connectionurl: connectionurl, querystring: querystring }; }(); $.connection.hub.url = settings.connectionurl; $.connection.hub.qs = settings.querystring; $.connection.hub.logging = true; $.connection.hub.start();
here's output chrome 35:
[20:27:50 gmt-0500 (central daylight time)] signalr: auto detected cross domain url. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:50 gmt-0500 (central daylight time)] signalr: client subscribed hub 'calendarhub'. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:50 gmt-0500 (central daylight time)] signalr: client subscribed hub 'emailhub'. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:50 gmt-0500 (central daylight time)] signalr: client subscribed hub 'notificationshub'. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:50 gmt-0500 (central daylight time)] signalr: negotiating 'https://signalr.mydomain.com/signalr/negotiate?email=jde…ub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&clientprotocol=1.3'. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:51 gmt-0500 (central daylight time)] signalr: attempting connect sse endpoint 'https://signalr.mydomain.com/signalr/connect?transport=s…2%3a%22emailhub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&tid=2'. jquery.signalr-2.0.3.min.js?_=1403573268960:8 eventsource cannot load https://signalr.mydomain.com/signalr/connect?transport=s…2%3a%22emailhub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&tid=2. no 'access-control-allow-origin' header nowadays on requested resource. origin 'https://webapp.mydomain.com' hence not allowed access. 764:1 [20:27:52 gmt-0500 (central daylight time)] signalr: eventsource calling close(). jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:52 gmt-0500 (central daylight time)] signalr: opening long polling request 'https://signalr.mydomain.com/signalr/connect?transport=l…2%3a%22emailhub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&tid=5'. jquery.signalr-2.0.3.min.js?_=1403573268960:8 xmlhttprequest cannot load https://signalr.mydomain.com/signalr/connect?transport=l…22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&tid=5&_=1403573269504. no 'access-control-allow-origin' header nowadays on requested resource. origin 'https://webapp.mydomain.com' hence not allowed access. 764:1 // $.connection.hub.start().fail(...) called [20:27:53 gmt-0500 (central daylight time)] signalr: stopping connection. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:53 gmt-0500 (central daylight time)] signalr: fired ajax abort async = true. jquery.signalr-2.0.3.min.js?_=1403573268960:8 [20:27:53 gmt-0500 (central daylight time)] signalr: longpolling failed connect. jquery.signalr-2.0.3.min.js?_=1403573268960:8
here's output firefox 28:
"[20:46:01 gmt-0500 (central standard time)] signalr: auto detected cross domain url." jquery.signalr-2.0.3.min.js:8 "[20:46:01 gmt-0500 (central standard time)] signalr: client subscribed hub 'calendarhub'." jquery.signalr-2.0.3.min.js:8 "[20:46:01 gmt-0500 (central standard time)] signalr: client subscribed hub 'emailhub'." jquery.signalr-2.0.3.min.js:8 "[20:46:01 gmt-0500 (central standard time)] signalr: client subscribed hub 'notificationshub'." jquery.signalr-2.0.3.min.js:8 "[20:46:01 gmt-0500 (central standard time)] signalr: negotiating 'https://signalr.mydomain.com/signalr/negotiate?email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22calendarhub%22%7d%2c%7b%22name%22%3a%22emailhub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&clientprotocol=1.3'." jquery.signalr-2.0.3.min.js:8 "[20:46:01 gmt-0500 (central standard time)] signalr: attempting connect sse endpoint 'https://signalr.mydomain.com/signalr/connect?transport=serversentevents&connectiontoken=irphki69y7w99kttn4tdakwkks%2fordopvxdovoxmxultpljfqihin%2blcrux6h8osfmhl6a2smla7ex5ntji8h1jwykxzoa82nu6su1xfgcxtwwcfic3k1r0auenz5w3h&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22calendarhub%22%7d%2c%7b%22name%22%3a%22emailhub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&tid=1'." jquery.signalr-2.0.3.min.js:8 "[20:46:02 gmt-0500 (central standard time)] signalr: eventsource calling close()." jquery.signalr-2.0.3.min.js:8 "[20:46:03 gmt-0500 (central standard time)] signalr: opening long polling request 'https://signalr.mydomain.com/signalr/connect?transport=longpolling&connectiontoken=irphki69y7w99kttn4tdakwkks%2fordopvxdovoxmxultpljfqihin%2blcrux6h8osfmhl6a2smla7ex5ntji8h1jwykxzoa82nu6su1xfgcxtwwcfic3k1r0auenz5w3h&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22calendarhub%22%7d%2c%7b%22name%22%3a%22emailhub%22%7d%2c%7b%22name%22%3a%22notificationshub%22%7d%5d&tid=3'." jquery.signalr-2.0.3.min.js:8 // $.connection.hub.start().fail(...) called "[20:46:03 gmt-0500 (central standard time)] signalr: stopping connection." jquery.signalr-2.0.3.min.js:8 "[20:46:03 gmt-0500 (central standard time)] signalr: fired ajax abort async = true." jquery.signalr-2.0.3.min.js:8 "[20:46:03 gmt-0500 (central standard time)] signalr: longpolling failed connect."
here's output ie 11, works:
[20:51:08 gmt-0500 (central daylight time)] signalr: auto detected cross domain url. [20:51:08 gmt-0500 (central daylight time)] signalr: client subscribed hub 'emailhub'. [20:51:08 gmt-0500 (central daylight time)] signalr: negotiating 'https://signalr.mydomain.com/signalr/negotiate?email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&clientprotocol=1.3'. sec7118: xmlhttprequest https://signalr.mydomain.com/signalr/negotiate?email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&clientprotocol=1.3&_=1403574667061 required cross origin resource sharing (cors). file: 764 [20:51:09 gmt-0500 (central daylight time)] signalr: browser doesn't back upwards sse. [20:51:10 gmt-0500 (central daylight time)] signalr: opening long polling request 'https://signalr.mydomain.com:443/signalr/connect?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&tid=0'. sec7118: xmlhttprequest https://signalr.mydomain.com/signalr/connect?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&tid=0&_=1403574667062 required cross origin resource sharing (cors). file: 764 [20:51:10 gmt-0500 (central daylight time)] signalr: long poll complete. [20:51:10 gmt-0500 (central daylight time)] signalr: opening long polling request 'https://signalr.mydomain.com:443/signalr/poll?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&groupstoken=7bwxejwvfqtnj3x0s%2fxpfhrzp3cpmj1x8zo7xnrixaoqourl5uxknmsyfxkxpfyel6%2b2rlhx6jqpy8srijzrrhxr%2btlc7ygk3x28v3%2bj8yjujn082h0c15l7henutjw3rrxzujc8qyfojnoiq%2bszdi0d28syxbvfsarzyivlhhw%3d&messageid=d-b0017e39-h%2c0%7cm%2c0%7cn%2c1%7co%2c0%7cl%2c0&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&tid=1'. sec7118: xmlhttprequest https://signalr.mydomain.com/signalr/poll?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&groupstoken=7bwxejwvfqtnj3x0s%2fxpfhrzp3cpmj1x8zo7xnrixaoqourl5uxknmsyfxkxpfyel6%2b2rlhx6jqpy8srijzrrhxr%2btlc7ygk3x28v3%2bj8yjujn082h0c15l7henutjw3rrxzujc8qyfojnoiq%2bszdi0d28syxbvfsarzyivlhhw%3d&messageid=d-b0017e39-h%2c0%7cm%2c0%7cn%2c1%7co%2c0%7cl%2c0&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&tid=1&_=1403574667063 required cross origin resource sharing (cors). file: 764 [20:51:11 gmt-0500 (central daylight time)] signalr: long poll complete. [20:51:11 gmt-0500 (central daylight time)] signalr: longpolling connected. connected, connection id=8a624246-0e75-4dfc-99aa-8540da9e429d [20:51:11 gmt-0500 (central daylight time)] signalr: invoking emailhub.refreshemail sec7118: xmlhttprequest https://signalr.mydomain.com/signalr/send?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d required cross origin resource sharing (cors). file: 764 notifications hub connected, connection id=8a624246-0e75-4dfc-99aa-8540da9e429d connected, connection id=8a624246-0e75-4dfc-99aa-8540da9e429d [20:51:11 gmt-0500 (central daylight time)] signalr: invoking calendarhub.refreshcalendar sec7118: xmlhttprequest https://signalr.mydomain.com/signalr/send?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d required cross origin resource sharing (cors). file: 764 [20:51:11 gmt-0500 (central daylight time)] signalr: opening long polling request 'https://signalr.mydomain.com:443/signalr/poll?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&groupstoken=7bwxejwvfqtnj3x0s%2fxpfhrzp3cpmj1x8zo7xnrixaoqourl5uxknmsyfxkxpfyel6%2b2rlhx6jqpy8srijzrrhxr%2btlc7ygk3x28v3%2bj8yjujn082h0c15l7henutjw3rrxzujc8qyfojnoiq%2bszdi0d28syxbvfsarzyivlhhw%3d&messageid=d-b0017e39-h%2c0%7cm%2c0%7cn%2c2%7co%2c0%7cl%2c0&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&tid=0'. sec7118: xmlhttprequest https://signalr.mydomain.com/signalr/poll?transport=longpolling&connectiontoken=oriixgpqgaug03ezcfexkht20wlpmnagizi%2ft5r7ci1nkrrcaenjbfvwfxrf7ogd7qwujyu%2fpc9jlfcpimcainvhhbi0crlucj1egfenxbdpk4c3wysnbak%2fghgorvok&groupstoken=7bwxejwvfqtnj3x0s%2fxpfhrzp3cpmj1x8zo7xnrixaoqourl5uxknmsyfxkxpfyel6%2b2rlhx6jqpy8srijzrrhxr%2btlc7ygk3x28v3%2bj8yjujn082h0c15l7henutjw3rrxzujc8qyfojnoiq%2bszdi0d28syxbvfsarzyivlhhw%3d&messageid=d-b0017e39-h%2c0%7cm%2c0%7cn%2c2%7co%2c0%7cl%2c0&email=jdentler%40dwhomes.com&windowsaccountname=jdentler&connectiondata=%5b%7b%22name%22%3a%22emailhub%22%7d%5d&tid=0&_=1403574667064 required cross origin resource sharing (cors). file: 764
it turns out request connect failing. because 1 of hubs replying new connection info blew json serializer. resulting 500 response didn't have cors headers, well-behaving browsers ignored response. fiddler friend. error pipeline signalr docs.
cross-domain signalr long-polling signalr-hub
Comments
Post a Comment