QuantumMechanics / NEM-sdk

NEM Developer Kit for Node.js and the browser
MIT License
137 stars 82 forks source link

A workaround for the "A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header..." issue? #44

Open csleary opened 6 years ago

csleary commented 6 years ago

Hi folks. I noticed the issue mentioned in the readme about using the latest version of SockJS in the browser and the resulting errors.

It looks like this has been raised in this thread, and can either be solved by making a tweak in the server middleware, or worked around by patching the connection function in the client to set the header opts.

I tried the latter monkeypatch when playing around with sockjs and webstomp-client (seems to be a more recent/active stomp client than sockjs), and found this sorted the issue for browser use. So perhaps including the earlier version of SockJS will no longer be necessary?