Just indicate the title in your request, what it does, it only allows requests from a specific domain and instantly rejects any other domain.
response.set('Access-Control-Allow-Origin', 'domain.tld');
EDIT: IF you are really interested in using web clips, you can make the function of double checking the origin of the client.
function checkOrigin (origin) { if (origin === "your.domain.tld") { return true; } else { return false; } } if (checkOrigin(response.headers.origin)) {
The following example should work for the default HTTP / HTTPS module, and should also work for Express, if I'm not mistaken.
EDIT 2: To return my expression that it should work for Express as well, I found this quote in my documentation;
Req (request) and res (response) are the same objects as Node, so you can call req.pipe (), req.on ('data', callback) and everything else that you are without Express.
source share