0
我目前已將tarang:Meteor-ssl-proxy安裝爲單獨的節點應用程序。它使我通過https://
訪問我的流星的應用程序不過,我仍然能夠訪問應用程序流星通過它的默認localhost:3000
(或它的主機IP:3000例如:1.2.3.4:3000)啓用SSL時禁用HTTP
究竟如何停用?通過3000
直接訪問應用程序?
我已經試過force-ssl包,但它沒有強制用戶使用https。
這裏是我的taranag-SSL的main.js:
~/experimental/Meteor-SSL-proxy$ cat main.js
var PATH_TO_KEY = "/etc/ssl/server.key",
PATH_TO_CERT = "/etc/ssl/server.crt";
PATH_TO_CHAIN = "";
var fs = require('fs'),
httpProxy = require('http-proxy');
var options = {
ssl: {
key: fs.readFileSync(PATH_TO_KEY, 'utf8'),
cert: fs.readFileSync(PATH_TO_CERT, 'utf8'),
//ca : fs.readFileSync(PATH_TO_CHAIN, 'utf8')
},
target : "http://localhost:3000",
ws: true,
xfwd: true
};
var server = httpProxy.createProxyServer(options).listen(443);