1.0.14 • Published 3 years ago

@anzerr/proxy.util v1.0.14

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

Intro

GitHub Actions status | publish

Proxy request to a server transforming the headers or url

Install

npm install --save git+https://github.com/anzerr/proxy.util.git
npm install --save @anzerr/proxy.util

Example

const Proxy = require('proxy.util'),
	{Server} = require('http.server');

let proxy = new Proxy('https://www.google.com'),
	http = new Server(8080);

proxy.on('request', (req) => {
	console.log('forward url', req.url);
	req.done();
});

http.create((req, res) => {
	proxy.forward(req._req, res._res).catch((e) => {
		res.status(500).send(e.toString());
	});
}).then(() => {
	console.log('started server on port', 8080);
});
1.0.14

3 years ago

1.0.13

4 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.6

6 years ago

1.0.4

6 years ago

1.0.5

6 years ago