Skip to content

为Nodejs 提供代理服务,并支持动态分配Server监听端口

Notifications You must be signed in to change notification settings

hxfdarling/bifrost-proxy

Repository files navigation

bifrost-proxy

为 Nodejs 提供全局代理服务,可以拦截所有从 Nodejs 发出的请求,并配置自定义代理服务器

用法:

在项目中安装 npm i bifrost-proxy

修改启动代码

// 设置代理地址和端口
process.env.BIFROST_HOST = '127.0.0.1';
process.env.BIFROST_PORT = '8899';
process.env.BIFROST = 'true'; // 启动代理

// 允许自定义证书
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

require('bifrost-proxy'); // 必须要在业务代码前面
// you code...
const Koa = require('koa');
// you code...

About

为Nodejs 提供代理服务,并支持动态分配Server监听端口

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published