2.0.0 • Published 2 years ago
static-web-proxy v2.0.0
static web proxy
静态网站代理转发容器
安装
npm i static-web-proxy --save
使用
const Proxy = require('static-web-proxy')
const proxy = new Proxy({
proxy: [
{ //代理
host: 'localhost', //代理HOST
scheme: 'http', //协议(可选,默认http)
port: 80, //代理端口
targetPath:'/', //代理根路径
path: '/apin', //原目录(会代理到代理服务的'/'目录)
auth: (req, res) => {}, //签名方法(可选)
heartBeat: 5000 //心跳检测 默认不开启
}
],
web: {
dir: path.join(__dirname, '/dist'), //静态网站目录
index: 'index.html' //初始页面文件
},
bind:{ //启动绑定
host: '0.0.0.0',
port: 8080
},
compression: true, // gzip默认为true
redirect: { //重定向
'/a/b': {
target: '/c/d',
query: {
'name': 'bbbb'
}
}
}
})
proxy.start()
2.0.0
2 years ago
1.3.7
4 years ago
1.3.6
5 years ago
1.3.5
5 years ago
1.3.4
5 years ago
1.3.3
5 years ago
1.3.2
5 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.62
7 years ago
1.0.61
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago