【发布时间】:2017-05-30 19:14:49
【问题描述】:
我在使用 socket.io 时遇到以下错误
XMLHttpRequest cannot load https://******:3000/socket.io/?
EIO=3&transport=polling&t=LPBFdGH. A wildcard '*' cannot be used in the 'Access-Cont
rol-Allow-Origin' header when the credentials flag is true.
Origin 'https://*****.com' is therefore not allowed
access. The credentials mode of an XMLHttpRequest is controlled by the
withCredentials attribute
我已经使用 CORS 将属性设置为无效。
app.use(cors({ 出处:真实, 凭据:真 }));
还有其他方法吗?
【问题讨论】:
标签: javascript node.js sockets socket.io