Express+Socket.io 'Access-Control-Allow-Origin'问题

1.后端socket.io配置

https://img1.mukewang.com/5c20c75300016e8012030469.jpg

https://img1.mukewang.com/5c20c75d0001b34409110247.jpg

2.前端连接

const socket = io('domain.com:12345')

3.错误信息

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.


拉莫斯之舞
浏览 966回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript