CometD
  1. CometD
  2. COMETD-267

Cometd cross-origin (xdomain) in IE is unable to use long-polling

    Details

      Description

      For CORS IE is expecting to use XDomainRequest instead of XMLHttpRequest object, dojo 1.6 has XDomainRequest support in dojo.io.xhrPlugins but cometd is using dojo.io.script.get during xdomain scenario.

      I am not sure but I was reading about "XDomainRequestAllow" header that is being expected by IE when XDomainRequest object is being used in format: "XDomainRequestAllow: 1"

      Probably improvements in this area could allow for IE to use long-polling.

      Dojo short discussion about the topic:
      http://dojo-toolkit.33424.n3.nabble.com/Cross-domain-XMLHttpRequest-with-Dojo-td1864416.html#a1864515
      Other resources:
      http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross.

        Issue Links

          Activity

          Hide
          PS added a comment -

          Any chance this will make it into announced Cometd 2.4.0 release?

          Show
          PS added a comment - Any chance this will make it into announced Cometd 2.4.0 release?
          Hide
          PS added a comment -

          I found following page http://www.sitepen.com/blog/2008/07/31/cross-site-xhr-plugin-registry/

          Had high hopes as reading "Now we can use cross-site XHR and XDomainRequest handling for XHR calls", so I tried it but no go, IE is still using callback-polling instead of long-polling.

          Any idea what I am missing here? Doesn't cometd uses dojo.xhr calls?

          Cometd 2.3.1

          Show
          PS added a comment - I found following page http://www.sitepen.com/blog/2008/07/31/cross-site-xhr-plugin-registry/ Had high hopes as reading "Now we can use cross-site XHR and XDomainRequest handling for XHR calls", so I tried it but no go, IE is still using callback-polling instead of long-polling. Any idea what I am missing here? Doesn't cometd uses dojo.xhr calls? Cometd 2.3.1
          Hide
          Simone Bordet added a comment - - edited

          I followed the instructions at http://www.sitepen.com/blog/2008/07/31/cross-site-xhr-plugin-registry/, and I was able to successfully use cross-origin requests with IE8.

          What I have done was:

          • add dojo.require("dojox.io.xhrPlugins"); on top of javascript file
          • call dojox.io.xhrPlugins.addCrossSiteXhr("http://127.0.0.1:8080") as suggested in the blog
          • init cometd with a cross-origin URL {{dojox.cometd.init( { url: "http://127.0.0.1:8080/cometd" }

            );}}

          IE8 shows an alert that says that the site is opening resources not under control, and after that CometD uses the long-polling transport.

          Show
          Simone Bordet added a comment - - edited I followed the instructions at http://www.sitepen.com/blog/2008/07/31/cross-site-xhr-plugin-registry/ , and I was able to successfully use cross-origin requests with IE8. What I have done was: add dojo.require("dojox.io.xhrPlugins"); on top of javascript file call dojox.io.xhrPlugins.addCrossSiteXhr("http://127.0.0.1:8080") as suggested in the blog init cometd with a cross-origin URL {{dojox.cometd.init( { url: "http://127.0.0.1:8080/cometd" } );}} IE8 shows an alert that says that the site is opening resources not under control, and after that CometD uses the long-polling transport.
          Hide
          PS added a comment - - edited

          Jetty 7.5.1 and cometd 2.4.0.beta2

          Tested cometd demo dojo with IE9 (and IE9 in IE8 mode), this "fix" has no effect. IE is using callback-polling and not following proper way, responses arrive immediately after request (like multi-client would be active).

          Most connect responses do contain:
          "advice":

          {"interval":2000,"reconnect":"retry","timeout":20000}

          But few contain only:
          "advice":

          {"interval":2000,"reconnect":"retry"}

          There is not multi-client advice present, new IE started, cleaned cache, cleaned cookies, single tab.

          Show
          PS added a comment - - edited Jetty 7.5.1 and cometd 2.4.0.beta2 Tested cometd demo dojo with IE9 (and IE9 in IE8 mode), this "fix" has no effect. IE is using callback-polling and not following proper way, responses arrive immediately after request (like multi-client would be active). Most connect responses do contain: "advice": {"interval":2000,"reconnect":"retry","timeout":20000} But few contain only: "advice": {"interval":2000,"reconnect":"retry"} There is not multi-client advice present, new IE started, cleaned cache, cleaned cookies, single tab.
          Hide
          Simone Bordet added a comment -

          It turned out that IE8 detects if the cross domain request is for the local host, and if so, it uses XMLHttpRequest and not XDomainRequest, and that is why it is working locally (for me) but not remotely (for Peter).

          With a remote setup, the instructions given above works fine but only along with the fix for COMETD-289 (to be shipped in CometD 2.4.0).

          Show
          Simone Bordet added a comment - It turned out that IE8 detects if the cross domain request is for the local host, and if so, it uses XMLHttpRequest and not XDomainRequest, and that is why it is working locally (for me) but not remotely (for Peter). With a remote setup, the instructions given above works fine but only along with the fix for COMETD-289 (to be shipped in CometD 2.4.0).

            People

            • Assignee:
              Simone Bordet
              Reporter:
              PS
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: