express-noginx

1.5.0 • Public • Published

noginx

a http/https proxy for nodejs

Feature

  1. http/https proxy
  2. 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

Readme

Keywords

Package Sidebar

Install

npm i express-noginx

Weekly Downloads

6

Version

1.5.0

License

MIT

Unpacked Size

314 kB

Total Files

11

Last publish

Collaborators

  • inu1255