odojs / redwire

A dynamic, high performance, load balancing reverse proxy
MIT License
34 stars 3 forks source link

HTTPS #10

Open julienamacher opened 8 years ago

julienamacher commented 8 years ago

For HTTPS to work, this following line in web-proxy.js (line 203) must be removed : this.certificates = new CertificateStore();

Config file:

rw._webProxy.certificates.add('site.net', { 'key': '/etc/letsencrypt/live/site.net/privkey.pem', 'cert': '/etc/letsencrypt/live/site.net/fullchain.pem' }); rw.httpsWs('site.net', 'localhost:8080'); rw.https('site.net', 'localhost:8080'); rw.http('site.net', rw.sslRedirect());

tcoats commented 8 years ago

Hi @julienamacher, thank you for your comment.

We are using something similar to the following in production:

var Redwire = require('redwire');
var redwire = new Redwire({
  http: {
    port: 80
  },
  https: {
    port: 443,
    key: './metoceanview.com.key',
    cert: './metoceanview.com.crt'
  }
});

redwire
  .https('metoceanview.com')
  .use(function(mount, url, req, res, next) {
    res.writeHead(200, {
      'Content-Type': 'text/plain'
    });
    res.write('ok');
    res.end();
  });

Is this the functionality you're after?

Internally a certificate store is used, but it hasn't been exposed as part of the API yet. Are you after something more dynamic? Something that can be altered at run time?