An open API service indexing awesome lists of open source software.

https://github.com/hxfdarling/bifrost-proxy

为Nodejs 提供代理服务,并支持动态分配Server监听端口
https://github.com/hxfdarling/bifrost-proxy

bifrost proxy

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# bifrost-proxy

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

**用法:**

在项目中安装 `npm i bifrost-proxy`

修改启动代码

```js
// 设置代理地址和端口
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...
```