【问题标题】:Error in mozilla firefox using socket.io使用 socket.io 的 mozilla firefox 出错
【发布时间】:2015-09-30 14:27:51
【问题描述】:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://jsgnr.eshopcomp.com/bwl/wl. (Reason: CORS request failed). <unknown>
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help http://xhr.spec.whatwg.org/ 

我在使用 mozilla 时遇到这种错误,在 chrome 中运行良好,而且我在节点控制台中遇到内存泄漏错误

【问题讨论】:

    标签: node.js cross-browser socket.io


    【解决方案1】:

    假设你可以访问服务器源,你可以尝试使用:

    io.set('origins', 'http://nameofyourdomain.com:80');
    

    显然,您需要将域/端口替换为适用于您的设置的域/端口。

    这个 Stack Overflow 答案 https://stackoverflow.com/a/21711242/5070356 对配置 origins 有很好的分解

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-17
      • 1970-01-01
      • 1970-01-01
      • 2015-02-18
      • 2011-08-08
      • 2016-08-09
      • 1970-01-01
      相关资源
      最近更新 更多