1

I am making a chat app and i am getting these errors (quite a few of them) Cross-Origin Request Blocked:
The Same Origin Policy disallows reading the remote resource at http://ps1.pubnub.com/subscribe/sub-c-43a257e0-d94a-11e4-a2b8-0619f8945a4f/my_channel%2Cmy_channel_resent/0/0?uuid=%20User%20Spyros%20with%20number%2080%20has%20come%20online%20&pnsdk=PubNub-JS-Web%2F3.6.7. (Reason: CORS request failed).

I literally do not know what to do, any ideas??

xdumaine
  • 10,096
  • 6
  • 62
  • 103
mpla_mpla
  • 313
  • 1
  • 2
  • 12

2 Answers2

2

PubNub does support CORS.

Are you on Firefox? Some people see the issue on FF when running a local server, but rebooting the browser often solves the case.

See: Firefox CORS request giving 'Cross-Origin Request Blocked' despite headers

Community
  • 1
  • 1
girlie_mac
  • 593
  • 5
  • 7
0

On PubNub’s network, the way data is sent and received on long-lived TCP socket connections, but with a browser, they expect to have special headers, otherwise known as CORS headers to allow certain resources over that connection. If a CORS header is excluded from the payload on a response, an error is thrown in the browser.

These occur when a TCP socket is severed through the browser. Essentially what’s occurring is that the browser notices that it’s missing a CORS header, so no data is coming down the pipe. What really should be happening is the browser should give a TCP socket error saying ‘severed’ or ‘aborted’, but it’s been implemented to deliver a CORS error.

What you really want to look out for is data loss, and if you are, please contact support@pubnub.com!

Bhavana
  • 81
  • 6
  • I have found, i think, data loss (what i checked was how many data leave the one peer and how many data arrive on the other peer). Is that what you mean? – mpla_mpla Jun 26 '15 at 16:09
  • Can you please message us on support@pubnub.com so we can look at this in detail? – Bhavana Jun 26 '15 at 18:49