代码拉取完成,页面将自动刷新
a proxy server wrapper for frontend development, easy to modify or replace remote files. Thanks for the great package node-http-proxy
npm i -g proxy-dev
You can use this package by cli parameters or config file, and use pd
for shotcut of proxy-dev
like the example below, you start a proxy server and target to website https://github.com
, -o/--open
means auto open browser. you can use 'proxy-dev -h' to see all available options.
proxy-dev -t https://github.com -o
use 'proxy-dev -i' to generate a config file in current directory, it will be load automatically if it exists.
it's a js module file like below:
module.exports = {
'target': 'https://yzhen123.github.io/',
'port': 8000,
replaceRules: [{
regex: /<p(.*?)>(.*?)<\/p>/g,
replace: '<p$1>I have being replaced, plz go to <a href="https://yzhen123.github.io/">real site</a></p>'
}],
rawMiddlewares: [function (rep, res, next) {
next()
}],
// custome confit for node-http-proxy, see https://github.com/nodejitsu/node-http-proxy
httpProxyConfig: { },
noCache: true,
open: true
}
MIT
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。