Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhoukekestar/aliyun-docker-https
Http to https for aliyun docker.
https://github.com/zhoukekestar/aliyun-docker-https
Last synced: about 5 hours ago
JSON representation
Http to https for aliyun docker.
- Host: GitHub
- URL: https://github.com/zhoukekestar/aliyun-docker-https
- Owner: zhoukekestar
- Created: 2016-12-29T02:51:18.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-29T05:47:44.000Z (almost 8 years ago)
- Last Synced: 2024-11-08T04:41:16.441Z (12 days ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aliyun-docker-https
Http to https for aliyun docker.# Quick Start
* `npm install aliyun-docker-https` to install `aliyun-docker-https`;
* express```js
var express = require('express')
, app = express()app.use(require('./index.js')({
ignore: ['/test/url$']
}));app.listen(3000)
console.log('express listen on 3000.')```
* koa```js
var app = require('koa')()
app.use(require('./index.js')({
ignore: ['/test/url$'],
mode: 'koa'
}));
app.listen(3000)
```
* test```bash
// 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
| Name | Description | Default value |
| --- | --- | --- |
| ignore | A url list should be ignored. | `*` |
| header | The header name. | `x-forwarded-proto` |
| mode | `express` or `koa` mode. | `express` |