Skip to content

fefeding/egg-jproxy

Repository files navigation

egg-jproxy

NPM version npm download

Install

$ npm i egg-jproxy --save

Usage

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

Configuration

// {app_root}/config/config.default.js
// 匹配请求 /jproxy/xx.cgi  指向127.0.0.1:8080,并带host:www.baidu.com
exports.jproxy = {
        ip: '127.0.0.1', // ipaddress  可选
        port: 8080,     // port  default:80 可选
        protocal: 'http', // http or https
        host:  'www.baidu.com',     // proxy domain
        match: /^\/jproxy\/(.*)\.(cgi|fcgi)/   // match  /jproxy/xxx.cgi
     };

也可以配置多个

// {app_root}/config/config.default.js
exports.jproxy = [
    {
        ip: '127.0.0.1', // ipaddress  可选
        port: 8080,     // port  default:80 可选
        protocal: 'http', // http or https
        host:  'www.baidu.com',     // proxy domain
        match: /^\/jproxy\/(.*)\.(cgi|fcgi)/   // match  /jproxy/xxx.cgi
     },
     // 把请求指向 www.baidu.com
     {
        host:  'http://www.baidu.com',     // proxy domain 如果不填使用当前域名
        match: /^\/jproxy\/(.*)\.(cgi|fcgi)/   // match  /jproxy/xxx.cgi
     }
  ];

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

About

egg-plugin http-proxy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy