Skip to content

Instantly share code, notes, and snippets.

@thoughtshop
Created November 22, 2013 23:26
Show Gist options
  • Save thoughtshop/7608619 to your computer and use it in GitHub Desktop.
Save thoughtshop/7608619 to your computer and use it in GitHub Desktop.
access control headers for node web sockets server
app = require('express')();
...
app.use(function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, OPTIONS');
res.header('Access-Control-Allow-Headers', 'Content-Type');
return next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment