wns-http-proxy

1.0.5 • Public • Published

wns-http-proxy

wns-http-proxy是用来做简单的http/https请求转发

Installation

npm install wns-http-proxy --save

Use Cases

    const wnsHttpProxy = require('wns-http-proxy');
    
    let proxyServer = wnsHttpProxy.createServer({
        port: 80,
        root: '/home/wannasky/workspace/test/'
    });
    
    proxyServer.setLocation({
       'test.baidu.com': {
           root: 'D:/workspace/github-workspace/test/',                   
           '/index': '/index.html',
           '/api': 'http://apistore.baidu.com/api/',                       
           '/service': {
               root: 'D:/workspace/github-workspace/test/',                
               '/user': 'http://apistore.baidu.com/service/user'
           }
       },
       
       ...
    });

Readme

Keywords

Package Sidebar

Install

npm i wns-http-proxy

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

11.5 kB

Total Files

8

Last publish

Collaborators

  • wannasky