Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

egg-http-proxy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-http-proxy

proxy middleware plugin for egg

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
64
increased by4.92%
Maintainers
1
Weekly downloads
 
Created
Source

egg-http-proxy

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Configure proxy middleware for egg. Use http-proxy-middleware.

Install

$ npm i egg-http-proxy --save

Usage

// {app_root}/config/plugin.js
exports.httpProxy = {
  enable: true,
  package: 'egg-http-proxy',
};

Configuration

Proxy /api requests to http://www.example.org:

// {app_root}/config/config.default.js
exports.httpProxy = {
  '/api': 'http://www.example.org'
};

A request to /api/users will now proxy the request to http://www.example.org/api/users.

If you don't want /api to be passed along, we need to rewrite the path:

// {app_root}/config/config.default.js
exports.httpProxy = {
  '/api': {
    target: 'http://www.example.org',
    pathRewrite: {'^/api' : ''}
  }
};

For more advanced usages, checkout http-proxy-middleware options documentation.

Questions & Suggestions

Please open an issue here.

License

MIT

Keywords

FAQs

Package last updated on 30 Dec 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc