Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibauts/node-host-filtering-proxy
A straightforward host filtering HTTP proxy
https://github.com/thibauts/node-host-filtering-proxy
Last synced: 21 days ago
JSON representation
A straightforward host filtering HTTP proxy
- Host: GitHub
- URL: https://github.com/thibauts/node-host-filtering-proxy
- Owner: thibauts
- Created: 2014-05-28T09:08:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-28T09:16:59.000Z (over 10 years ago)
- Last Synced: 2024-11-18T16:39:48.356Z (about 1 month ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
host-filtering-proxy
====================
### A straightforward host filtering HTTP proxySpawns a light HTTP proxy that allows you to filter requests based on requested host.
All you have to do is provide a callback that will receive the hostname and either accept or reject the request.
Basic HTTP proxying as well as tunneling are supported. This means HTTPS requests are filterable too.The code hasn't been extensively tested yet. Contributions are welcome.
Installation
------------``` bash
$ npm install host-filtering-proxy
```Examples
--------``` javascript
var hfp = require('host-filtering-proxy');var test = [
'ad.doubleclick.net',
'googleads.g.doubleclick.net',
'ib.adnxs.com',
'cdn.adnxs.com',
'ad.turn.com',
'cdn.turn.com'
];var proxy = hfp.createProxy(function(host, reject) {
if(test.indexOf(host) !== -1) {
reject(true);
} else {
reject(false);
}
})proxy.listen(8888, '127.0.0.1');
```