1.5.0 • Published 6 years ago
express-noginx v1.5.0
noginx
a http/https proxy for nodejs
Feature
- http/https proxy
- middleware use express
Demo
const noginx = require("express-noginx");
const app = noginx.express();
app.use(function(req, res, next) {
if (req.headers["host"] == "www.baidu.com") {
res.writeHead(200, { "content-type": "text/html;charset=utf8" });
res.write("哈哈!百度变成我的啦!!!");
res.end();
} else {
next();
}
});
app.listen(9999);
add the cert cert/ca.crt
to rootCertificate and trust it
proxy setting (such as SwitchyOmega
)
visit https://www.baidu.com