Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run file:///C:/soft/nodews/client/index.html , chrome not work ,but 360 browser(Webkit and Trident) is ok #5

Open
guowushi opened this issue Apr 6, 2018 · 1 comment

Comments

@guowushi
Copy link

guowushi commented Apr 6, 2018

Failed to load http://127.0.0.1:3000/socket.io/?EIO=3&transport=polling&t=MAP6H5v: The 'Access-Control-Allow-Origin' header has a value 'null' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.

@htfc786
Copy link

htfc786 commented Nov 19, 2022

打开server的源码index.js,找到第3行,改为

var io = require('socket.io')(http, { cors: true });

原理就是允许socket.io跨域
或者用nginx也可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants