1.0.2 • Published 7 years ago

host-proxy v1.0.2

Weekly downloads
19
License
MIT
Repository
github
Last release
7 years ago

HOST-PROXY

Fast, lightweight and transparent http(s) proxy that supports dynamic hostnames.

Installation

Npm

npm install host-proxy

Example

var createProxy = require('host-proxy');

// Start a proxy server.
createProxy(function (hostname, secure) {
	// Respond with an address to proxy to.
	// Result is passed to net.createConnection.
	return ({
		"test.com": "http://localhost:3002",
		"secure.test.com": "https://localhost:3003",
		"search.test.com": "http://google.ca",
		"api.test.com": { port: 12345, family: 'IPv4', address: "127.0.0.1" }
	})[hostname];
}).listen(80);

The above example creates the following proxy:

Contributions

  • Use npm to run tests.

Please feel free to create a PR!

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago