socket.io-p2p icon indicating copy to clipboard operation
socket.io-p2p copied to clipboard

COR issue

Open savethehousemouse opened this issue 6 years ago • 1 comments

Using the example chat unchanged I receive a "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://file/socket.io/?EIO=3&transport=polling&t=My7DERo. (Reason: CORS request did not succeed)."

message. Looking around for enabling CORS I found a few tips like: app.options('*', cors()) // include before other routes app.use(cors({origin: 'http://localhost:3000', }));

but I do not see where and how I can enable it in this app.

It would be great if you would COR enable the example app since it would make the example work again and I could learn how to use the solution in my app based on your example.

Thank you in advance g strubinsky

savethehousemouse avatar Dec 15 '19 01:12 savethehousemouse

app.use(cors({ origin: " * " })); app.options(' * ', cors());

I don't know whether you resolved this error or not. But, I overcame this issue by doing this.

Kothapalliprakash avatar Jun 09 '24 09:06 Kothapalliprakash