Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rexxars/mead-plugin-source-proxy
HTTP Proxy source for the Mead image transformer service - loads images from remote HTTP(s) servers
https://github.com/rexxars/mead-plugin-source-proxy
Last synced: 11 days ago
JSON representation
HTTP Proxy source for the Mead image transformer service - loads images from remote HTTP(s) servers
- Host: GitHub
- URL: https://github.com/rexxars/mead-plugin-source-proxy
- Owner: rexxars
- License: mit
- Created: 2016-08-30T06:34:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-16T08:33:02.000Z (over 7 years ago)
- Last Synced: 2024-10-11T07:13:23.641Z (about 1 month ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mead-plugin-source-proxy
[![npm version](http://img.shields.io/npm/v/mead-plugin-source-proxy.svg?style=flat-square)](http://browsenpm.org/package/mead-plugin-source-proxy)[![Build Status](http://img.shields.io/travis/rexxars/mead-plugin-source-proxy/master.svg?style=flat-square)](https://travis-ci.org/rexxars/mead-plugin-source-proxy)[![Coverage Status](https://img.shields.io/coveralls/rexxars/mead-plugin-source-proxy/master.svg?style=flat-square)](https://coveralls.io/github/rexxars/mead-plugin-source-proxy)[![Dependency status](https://img.shields.io/david/rexxars/mead-plugin-source-proxy.svg?style=flat-square)](https://david-dm.org/rexxars/mead-plugin-source-proxy)
HTTP Proxy source for the Mead image transformer service - loads images from remote HTTP(s) servers.
## Installation
```shell
# Bundled with mead by default, but if you're feeling frisky
npm install --save mead-plugin-source-proxy
```## Usage
**Note: Bundled with Mead and enabled by default**
Your mead configuration file (`mead --config `):
```js
module.exports = {
// Load the plugin
plugins: [
require('mead-plugin-source-proxy')
],// Define a source using the proxy adapter
sources: [{
name: 'my-proxy-source',
adapter: {
type 'proxy',
config: {
// Secure token is required for this source, to prevent abuse
secureUrlToken: 'someToken',// Disallow requests to hostnames that resolve to private IP ranges (disallowed by default)
allowPrivateHosts: false,// Optional, custom function to allow/disallow a request. Pass bool as second argument to the callback
allowRequest: (url, callback) => {
callback(null, url.includes('arnold'))
},// Time in milliseconds to wait upon connecting to remote server before giving up request (default: 7500)
timeout: 3500,// Maximum number of redirects to follow (default: 3)
maxRedirects: 1
}
}
}]
}
```## License
MIT-licensed. See LICENSE.