mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
add --secure flag to indicate proxy can support https requests
When --secure is set, all urls will be sent back with https so use will use secure proxy.
This commit is contained in:
@@ -119,6 +119,8 @@ function new_client(id, opt, cb) {
|
||||
module.exports = function(opt) {
|
||||
opt = opt || {};
|
||||
|
||||
var schema = opt.secure ? 'https' : 'http';
|
||||
|
||||
var app = express();
|
||||
|
||||
app.set('view engine', 'html');
|
||||
@@ -154,7 +156,7 @@ module.exports = function(opt) {
|
||||
return res.end(err.message);
|
||||
}
|
||||
|
||||
var url = 'https://' + req_id + '.' + req.headers.host;
|
||||
var url = schema + '://' + req_id + '.' + req.headers.host;
|
||||
info.url = url;
|
||||
res.end(JSON.stringify(info));
|
||||
});
|
||||
@@ -178,7 +180,7 @@ module.exports = function(opt) {
|
||||
return res.end(err.message);
|
||||
}
|
||||
|
||||
var url = 'https://' + req_id + '.' + req.headers.host;
|
||||
var url = schema + '://' + req_id + '.' + req.headers.host;
|
||||
info.url = url;
|
||||
res.end(JSON.stringify(info));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user