# urlproxy

> set a proxy for url using stream

Latest version **0.1.1** (published 2014-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install urlproxy
pnpm add urlproxy
yarn add urlproxy
bun add urlproxy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2014-08-15 |
| First published | 2014-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | popomore |
| Maintainers | popomore |

## Links

- npm: https://www.npmjs.com/package/urlproxy
- Repository: https://github.com/popomore/urlproxy
- Issues: https://github.com/popomore/urlproxy/issues
- npm.io page: https://npm.io/package/urlproxy

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ~1.0.4
- [extend](https://npm.io/package/extend.md) ~1.3.0
- [gulp-if](https://npm.io/package/gulp-if.md) ~1.2.4
- [request](https://npm.io/package/request.md) ~2.40.0
- [multipipe](https://npm.io/package/multipipe.md) ~0.1.1
- [fscache-stream](https://npm.io/package/fscache-stream.md) ~0.1.2

## Recent versions

- 0.1.1 (latest) — 2014-08-15
- 0.1.0 — 2014-08-15

## README

# urlproxy

[![NPM version](https://img.shields.io/npm/v/urlproxy.svg?style=flat)](https://npmjs.org/package/urlproxy)
[![Build Status](https://img.shields.io/travis/popomore/urlproxy.svg?style=flat)](https://travis-ci.org/popomore/urlproxy)
[![Build Status](https://img.shields.io/coveralls/popomore/urlproxy?style=flat)](https://coveralls.io/r/popomore/urlproxy)
[![NPM downloads](http://img.shields.io/npm/dm/urlproxy.svg?style=flat)](https://npmjs.org/package/urlproxy)

set a proxy for url using stream

---

## Install

```
$ npm install urlproxy -g
```

## Usage

```
var proxy = require('urlproxy');
proxy('a.js').pipe(res);
```

It will find the file in local directory. if not found, it will find from the proxy server, and cache to local if cache option is true.

custom `ready` event, when stream can be ready to pipe, when you use express or koa.

```
proxy('a.js')
.on('ready', function() {
  res.statusCode = 200;
})
.on('error', function() {
  res.statusCode = 404
  res.end('Not Found');
})
.pipe(res);
```

## Option

- directory: local directory, default `process.cwd()`,
- proxy: set remote server
- cache: cache remote file
- followRedirect: follow redirect when 302

## LISENCE

Copyright (c) 2014 popomore. Licensed under the MIT license.

---
_Source: https://npm.io/package/urlproxy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
