使用socket.io的mozilla firefox出错

时间:2015-07-12 04:52:24

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

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中工作正常时,我收到此类错误,并且我在节点控制台中出现内存泄漏错误

1 个答案:

答案 0 :(得分:1)

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

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

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

此Stack Overflow回答https://stackoverflow.com/a/21711242/5070356在配置origins

方面有很好的细分