xhr fallback cross domain issue

Front Page Forums Development xhr fallback cross domain issue

This topic contains 5 replies, has 1 voice, and was last updated by  James 1 year, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #5178 Reply


    Hi to everyone,

    I just want to state a technical issue just realized when trying publisher script. May be you already know then never mind 🙂
    Sometimes can fallback to xhr long polling instead of websocket because of poor connection I think. In this case browser blocks xhr requests because of cross origin request policy so can not send any data. I think you should configure websocket server side in order to response with suitable cross origin http headers.

    Cool project by the way. Congrats team

    #5182 Reply


    Hi Caner,

    This was not something I was aware of. I’ll try and get a fix rolled out before the weekend. Think the options are to try and set access-control headers without causing a security leak or just force websockets if this isn’t possible. There’s an interesting thread here:

    Will need to do some testing and replicate this in a dev environment.

    Thanks for sending this in.

    #5184 Reply


    Bwark I’ve had this issue by the past on an early stage version of Don’t remember how I fixed it, I remember it was painful though.
    Good luck!

    #5221 Reply


    I think this should be solved now. It’s a CORS issue with which wasn’t taking notice of the response headers set in the express app routes.

    Additionally we are loading the file from a 3rd party CDN which might have been adding to the problem.

    Anyway we’ve rolled out an update this evening and I’m hoping this should fix the issue although it’s not something we have been able to replicate here so hard to tell for sure. Let me know if you get any further errors.

    #5253 Reply


    Ok I have done a quick check by editing socket connection script a bit and it looks like the problem solved.
    I checked docs, this is how i replicate and force only xhr polling:

    var socket = io.connect(jseLoadServer, {transports: [‘polling’]});

    by this way only uses xhr instead of websocket. And it is working now without errors.

    #5255 Reply


    Thank you Caner, we had another issue with XHR polling giving an SSL error. We’ve tried forcing secure connections on an update which was rolled out about four hours ago which I’m hoping will put the socketio polling issues behind us.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: xhr fallback cross domain issue
Your information: