server.js 561 B

12345678910111213141516171819
  1. // silly chrome wants SSL to do screensharing
  2. var fs = require('fs'),
  3. express = require('express'),
  4. https = require('https'),
  5. http = require('http');
  6. var privateKey = fs.readFileSync('fakekeys/privatekey.pem').toString(),
  7. certificate = fs.readFileSync('fakekeys/certificate.pem').toString();
  8. var app = express();
  9. app.use(express.static(__dirname));
  10. https.createServer({key: privateKey, cert: certificate}, app).listen(8000);
  11. http.createServer(app).listen(8001);
  12. console.log('running on https://localhost:8000 and http://localhost:8001');