Socket
Socket
Sign inDemoInstall

@huangapple/midway-http-proxy

Package Overview
Dependencies
9
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @huangapple/midway-http-proxy

Midway Component for http proxy


Version published
Maintainers
1
Created

Readme

Source

HTTP 代理组件

HTTP 代理组件

适用于 @midwayjs/faas@midwayjs/web@midwayjs/koa@midwayjs/express 多种框架的 HTTP 代理组件,支持GET、POST等多种请求方法。

Usage

  1. 安装依赖
$ npm i @midwayjs/http-proxy --save
  1. 在 configuration 中引入组件,
import * as proxy from '@midwayjs/http-proxy';
@Configuration({
  imports: [
    // ...other components
    proxy
  ],
})
export class AutoConfiguration {}

配置

export const httpProxy = {
  host: 'http://127.0.0.1',
  match: /\/assets\/(.*)/,
  target: 'http://127.0.0.1/$1',

  //额外的axios请求config, 会照搬过去
  extReqOptions:{
    //用来设置不校验https的ssl
    httpsAgent: new https.Agent({ rejectUnauthorized: false })
  }
}

Keywords

FAQs

Last updated on 07 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc