Skip to content

Instantly share code, notes, and snippets.

@Batname
Created January 4, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Batname/c1e478bc46306ac00cfe to your computer and use it in GitHub Desktop.
Save Batname/c1e478bc46306ac00cfe to your computer and use it in GitHub Desktop.
var https = require('https'),
pem = require('pem');
pem.createCertificate({days:1, selfSigned:true}, function(err, keys){
https.createServer({key: keys.serviceKey, cert: keys.certificate}, function(req, res){
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
res.setHeader('content-type', 'text/html');
res.end(`<form target="_parent" action="http://localhost:8001/shopping" class="js-search-box-form"><input class="search-box-q js-search-box-q" type="text" value="" name="q" autocomplete="off" autocorrect="off" autocapitalize="off" maxlength="2048"><input id="qo" type="hidden" name="qo" value="homeSearchBox"><button class="search-box-button" type="submit" section="hdr.search" value="">Search</button></form>`);
}).listen(8000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment