1.0.6 • Published 5 years ago

http-proxy-lite v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

http-proxy-lite

NPM Version Node Version

a tiny http proxy of node.js

Installation

npm i http-proxy-lite -S

Usage

proxy server

import * as http from 'http';
import * as httpProxy from 'http-proxy-lite';

const proxy = httpProxy.createProxyServer();

http
  .createServer(function(req, res) {
    proxy.web(req, res, { target: 'http://127.0.0.1:3001' });
  })
  .listen(3000);

endpoint server

import * as http from 'http';

http
  .createServer(function(req, res) {
    res.end('hello, response from 3001');
  })
  .listen(3001);

then open http://localhost:3000/ with your browser, it will shows hello, response from 3001

Todo

  • xxxx

License

MIT

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago