0.0.3 • Published 7 years ago

aliyun-docker-https v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

aliyun-docker-https

Http to https for aliyun docker.

Quick Start

  • npm install aliyun-docker-https to install aliyun-docker-https;
  • express
var express = require('express')
  , app     = express()

app.use(require('./index.js')({
  ignore: ['/test/url$']
}));

app.listen(3000)
console.log('express listen on 3000.')
  • koa
var app = require('koa')()
app.use(require('./index.js')({
  ignore: ['/test/url$'],
  mode: 'koa'
}));
app.listen(3000)
  • test
// 302
curl -H 'x-forwarded-proto: http' -i  http://localhost:3000/
curl -H 'x-forwarded-proto: http' -i  http://localhost:3000/test/urla
curl -H 'x-forwarded-proto: http' -i  http://localhost:3000/test/urla?a=a

// 404
curl -H 'x-forwarded-proto: https' -i  http://localhost:3000/
curl -H 'x-forwarded-proto: https' -i  http://localhost:3000/test/url
curl -H 'x-forwarded-proto: http' -i  http://localhost:3000/test/url

Config

NameDescriptionDefault value
ignoreA url list should be ignored.*
headerThe header name.x-forwarded-proto
modeexpress or koa mode.express